From 46ee43c674ec697c6740b9a531ac0b6ff3a05ab4 Mon Sep 17 00:00:00 2001 From: Avram Gottschlich Date: Wed, 12 Jan 2022 12:23:22 -0500 Subject: [PATCH] Widened the expanded view boxes on the main board. Changed the answers display to a comma-separated string rather than a list. Spaced out the tags with commas. Moved the various lists of puzzles out of an interior loop (in generate_for_hunt_id) since it seemed unnecessary to generate those over and over again. --- html_generator.py | 25 +++++++++++++------------ overview.css | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/html_generator.py b/html_generator.py index e337f08..01cecde 100644 --- a/html_generator.py +++ b/html_generator.py @@ -198,7 +198,7 @@ def overview(hunt, puzzles, rounds): if puzzle['status'] == 'solved': expanding += [' \n', ' {}\n'.format(link(website + filename_from_name(puzzle['name']) + ".html", puzzle['name']+meta)), - ' {}\n'.format(puzzle['solution']), + ' {}\n'.format(", ".join(puzzle['solution']).upper()), ' \n'] else: expanding += [' \n', @@ -266,9 +266,9 @@ def round_overview(hunt, rnd, puzzles): ' {}\n'.format(elink(puzzle.get('url',''), 'Puzzle')), ' {}\n'.format(elink(puzzle['sheet_url'], 'Sheet')), ' {}\n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')), - ' {}\n'.format(puzzle['solution']), + ' {}\n'.format(", ".join(puzzle['solution']).upper()), # ' \n', - ' {}\n'.format("".join(puzzle.get('tags',[]))), + ' {}\n'.format(", ".join(puzzle.get('tags',[]))), ' \n'] else: puzzle_list += [ ' \n', @@ -278,7 +278,7 @@ def round_overview(hunt, rnd, puzzles): ' {}\n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')), ' \n', # ' \n', - ' {}\n'.format(" ".join(puzzle.get('tags',[]))), + ' {}\n'.format(", ".join(puzzle.get('tags',[]))), ' \n'] end = [' \n', ' \n', @@ -308,7 +308,7 @@ def puzzle_overview(hunt, puzzle): else: round_url = '' if puzzle['status'] == 'solved': - solution = puzzle['solution'] + solution = ", ".join(puzzle['solution']).upper() status = 'solved' else: solution = "" @@ -337,7 +337,7 @@ def puzzle_overview(hunt, puzzle): ' \n', ' \n', ' \n'.format(" ".join(round_url)), #round page on our site - ' \n'.format(" ".join(puzzle.get('tags',[]))), #add tags + ' \n'.format(", ".join(puzzle.get('tags',[]))), #add tags ' \n', ' \n', ' \n'.format(solution), @@ -410,9 +410,9 @@ def puzzle_lists(hunt, puzzles, filt): ' \n'.format(elink(puzzle.get('url',''), 'Puzzle')), ' \n'.format(elink(puzzle['sheet_url'], 'Sheet')), ' \n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')), - ' \n'.format(puzzle['solution']), + ' \n'.format(", ".join(puzzle['solution']).upper()), ' \n'.format(round_url), - ' \n'.format("".join(puzzle.get('tags',[]))), + ' \n'.format(", ".join(puzzle.get('tags',[]))), ' \n'] for puzzle in unsolved_puzzles: if puzzle['type'] == 'meta': @@ -433,7 +433,7 @@ def puzzle_lists(hunt, puzzles, filt): ' \n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')), ' \n', ' \n'.format(round_url), - ' \n'.format("".join(puzzle.get('tags',[]))), + ' \n'.format(", ".join(puzzle.get('tags',[]))), ' \n'] end = [' \n', '
Round(s): {}Tags: {}Tags: {}
Answer: {}{}{}{}{}{}{}{}{}
{}{}{}{}
\n', @@ -479,9 +479,10 @@ def generate_for_hunt_id(table, hunt_id): round_overview(hunt, rnd, puzzles) for puzzle in puzzles: puzzle_overview(hunt, puzzle) - puzzle_lists(hunt, puzzles, "All") - puzzle_lists(hunt, puzzles, "Solved") - puzzle_lists(hunt, puzzles, "Unsolved") + puzzle_lists(hunt, puzzles, "All") + puzzle_lists(hunt, puzzles, "Solved") + puzzle_lists(hunt, puzzles, "Unsolved") + # Initialize AWS resources to talk to the database db = boto3.resource('dynamodb') diff --git a/overview.css b/overview.css index 8426fb2..d79cc0a 100644 --- a/overview.css +++ b/overview.css @@ -1,4 +1,4 @@ -/* The grid: Three equal columns that floats next to each other */ +/* The grid: columns that float next to each other */ .column { float: left; width: 15%; @@ -16,7 +16,7 @@ color: black; border-radius: 25px; margin: auto; - width: 20%; + width: 40%; } -- 2.43.0