summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e7ee7e4)
And display all meta puzzles with a bold "META" prefix.
input_block("Puzzle URL", "url", "External URL of puzzle",
initial_value=puzzle.get("url", None),
optional=True),
input_block("Puzzle URL", "url", "External URL of puzzle",
initial_value=puzzle.get("url", None),
optional=True),
+ checkbox_block("Is this a meta puzzle?", "Meta", "meta",
+ checked=(puzzle.get('type', 'plain') == 'meta')),
* round_options_block,
input_block("New round(s)", "new_rounds",
"New round(s) this puzzle belongs to " +
* round_options_block,
input_block("New round(s)", "new_rounds",
"New round(s) this puzzle belongs to " +
url = state['url']['url']['value']
if url:
puzzle['url'] = url
url = state['url']['url']['value']
if url:
puzzle['url'] = url
+ if state['meta']['meta']['selected_options']:
+ puzzle['type'] = 'meta'
+ else:
+ puzzle['type'] = 'plain'
rounds = [option['value'] for option in
state['rounds']['rounds']['selected_options']]
if rounds:
rounds = [option['value'] for option in
state['rounds']['rounds']['selected_options']]
if rounds:
input_block("Puzzle name", "name", "Name of the puzzle"),
input_block("Puzzle URL", "url", "External URL of puzzle",
optional=True),
input_block("Puzzle name", "name", "Name of the puzzle"),
input_block("Puzzle URL", "url", "External URL of puzzle",
optional=True),
+ checkbox_block("Is this a meta puzzle?", "Meta", "meta"),
* round_options_block,
input_block("New round(s)", "new_rounds",
"New round(s) this puzzle belongs to " +
* round_options_block,
input_block("New round(s)", "new_rounds",
"New round(s) this puzzle belongs to " +
state = payload['view']['state']['values']
name = state['name']['name']['value']
url = state['url']['url']['value']
state = payload['view']['state']['values']
name = state['name']['name']['value']
url = state['url']['url']['value']
+ if state['meta']['meta']['selected_options']:
+ puzzle_type = 'meta'
+ else:
+ puzzle_type = 'plain'
if 'rounds' in state:
rounds = [option['value'] for option in
state['rounds']['rounds']['selected_options']]
if 'rounds' in state:
rounds = [option['value'] for option in
state['rounds']['rounds']['selected_options']]
"solution": [],
"status": 'unsolved',
"name": name,
"solution": [],
"status": 'unsolved',
"name": name,
}
if url:
item['url'] = url
}
if url:
item['url'] = url
if len(solution):
solution_str = "*`" + '`, `'.join(solution) + "`*"
if len(solution):
solution_str = "*`" + '`, `'.join(solution) + "`*"
+ meta_str = ''
+ if puzzle.get('type', 'plain') == 'meta':
+ meta_str = "*META* "
+
links = []
if url:
links.append("<{}|Puzzle>".format(url))
links = []
if url:
links.append("<{}|Puzzle>".format(url))
- puzzle_text = "{}{} <{}|{}> ({}){}{}".format(
+ puzzle_text = "{}{} {}<{}|{}> ({}){}{}".format(
status_emoji, solution_str,
status_emoji, solution_str,
channel_url(channel_id), name,
', '.join(links), rounds_str,
state_str
channel_url(channel_id), name,
', '.join(links), rounds_str,
state_str