Templates
This document describes the templates used in the PuzzleSpring application.
Root
access_error.html
Description: Displays an error message when a user tries to access a resource they don’t have permission to view.
Extends: info_base.html
Context Variables:
reason: The reason for access denial (‘hunt’, ‘team’, ‘puzzle’, or ‘hint’)
Template Blocks:
title: Sets page title to “Not Available”content: Displays the appropriate error message based on the reason
archive.html
Description: Displays a list of all past puzzle hunts in reverse chronological order with links to their pages.
Extends: info_base.html
Context Variables:
hunts: List of all past Hunt objects with their associated data
Template Blocks:
content: Displays a table of past hunts with links to their various pages
base.html
Description: The base template that all other templates extend from. Provides the basic HTML structure, meta tags, and common includes.
Template Blocks:
title_meta_elements: Block containing all meta elements for the page title and social sharingextra_meta_elements: Block for additional meta elementsfavicon: Block for the faviconbase_includes: Block for including base CSS/JS filesbulma_includes: Block for including Bulma-specific CSS/JS filesincludes: Block for template-specific includesextra_head: Block for additional head contentcontent_wrapper: Block containing the main content wrapper structurecontent: Block for the main content of the pagefooter: Block containing the footer contentextra_body: Block for additional body content
hint_unlock_plan_formset.html
Description: Form for configuring hint unlock plans in the staff interface.
Context Variables:
hunt: The current Hunt objectformset: Django formset for hint unlock plan configuration
hunt_base.html
Description: Base template for hunt-related pages. Provides hunt-specific styling and real-time updates via SSE.
Extends: base.html
Context Variables:
tmpl_hunt: The current hunt objectteam: The current team object (optional)title: Optional page title override
Template Blocks:
title_meta_elements: Overrides title meta elements to include hunt namebase_includes: Adds hunt-specific CSS and custom hunt CSS if availablebulma_includes: Removes default Bulma includescontent_wrapper: Adds SSE-based live updates for hunt contentcontent: Block for hunt-specific contentfooter: Removes default footer
hunt_info_base.html
Description: Base template for hunt information pages with a centered content layout.
Extends: info_base.html
Template Blocks:
title: Sets page title to “Hunt Details”content_wrapper: Provides a centered content layout with specific widthcontent: Block for hunt information content
hunt_info_non_template.html
Description: Displays hunt information page for non-template hunts.
Extends: hunt_info_base.html
Context Variables:
hunt: The current Hunt object
Template Blocks:
content: The main content area displaying hunt details and rules
hunt_non_template.html
Description: Displays a simple list view of all puzzles in a hunt with their solve status and answers.
Extends: hunt_base.html
Context Variables:
hunt: The current Hunt objectteam: The current Team objectpuzzles: List of all Puzzle objects in the huntsolved: List of puzzles that have been solved by the team
Template Blocks:
content_wrapper: Displays hunt title, team name, and puzzle list table
index.html
Description: The home page of the puzzlehunt website.
Extends: info_base.html
Context Variables:
curr_hunt: The current hunt object
Template Blocks:
content: The content of the page
info_base.html
Description: Base template for informational pages. Provides a centered content layout with configurable width.
Extends: base.html
Context Variables:
info_size: Controls the width of the content (‘full-width’, ‘wide’, ‘narrow’, ‘narrow_padded’, or default)
Template Blocks:
base_includes: Adds info-specific CSScontent_wrapper: Provides a centered content layout with configurable widthcontent: Block for page-specific content
leaderboard.html
Description: Displays a leaderboard of teams for a specific hunt with customizable ranking rules.
Extends: info_base.html
Context Variables:
hunt: The Hunt object being displayedruleset: List of LeaderboardRule objects defining the columns and ranking rulesteam_data: List of Team objects with their ranking data
Template Blocks:
title_meta_elements: Sets page title to include hunt namecontent_wrapper: Sets wide layout for the leaderboardcontent: Displays the leaderboard table with team rankings
notification_detail.html
Description: Displays and manages user notification preferences and subscriptions.
Extends: allauth/layouts/manage.html
Context Variables:
form: Form for adding new notification subscriptions
Template Blocks:
content: Displays current subscriptions and a form to add new ones
notification_table.html
Description: Displays a table of notification subscriptions with platform, hunt, event types, and management controls.
Context Variables:
subscriptions: List of NotificationSubscription objectsevent_type_choices: List of tuples containing event type choices
partial_header.html
Description: Partial template for displaying message container if messages exist.
Context Variables:
messages: List of messages to display
prepuzzle_base.html
Description: Base template for prepuzzle pages. Provides answer checking functionality.
Extends: base.html
Context Variables:
puzzle: The current prepuzzle object
Template Blocks:
title_meta_elements: Sets page title to puzzle namebase_includes: Adds JavaScript for answer checkingcontent: Block for prepuzzle-specific content
prepuzzle_infobox.html
Description: Displays the information box for a prepuzzle, including title and answer submission form.
Context Variables:
puzzle: The current prepuzzle objectform: Form for submitting prepuzzle answers
prepuzzle_non_template.html
Description: Displays a non-template prepuzzle, supporting HTML and PDF file types.
Extends: puzzle_base.html
Context Variables:
puzzle: The current prepuzzle object
Template Blocks:
content: The main content area displaying the puzzle content
puzzle_base.html
Description: Base template for puzzle pages. Provides puzzle-specific layout and info box.
Extends: hunt_base.html
Context Variables:
puzzle: The current puzzle objectis_prepuzzle: Template tag result indicating if this is a prepuzzle
Template Blocks:
title_meta_elements: Sets page title to puzzle namecontent_wrapper: Adds puzzle info box sectioncontent: Block for puzzle-specific content
puzzle_hints.html
Description: Displays hint request form and previous hints for a puzzle with real-time updates via SSE.
Extends: hunt_base.html
Context Variables:
puzzle: The puzzle object hints are being requested forteam: The current team objecthints: List of previous Hint objects for this puzzlestatus: PuzzleStatus object for this team and puzzle
Template Blocks:
title_meta_elements: Sets page title to puzzle name with “Hints” suffixcontent_wrapper: Displays hint request form and previous hints
puzzle_infobox.html
Description: Displays puzzle information box with answer submission, stats, hints access, and updates.
Context Variables:
puzzle: The current Puzzle objectteam: The current Team objectform: Form for submitting puzzle answersupdates: List of Update objects for this puzzle
puzzle_non_template.html
Description: Displays a non-template puzzle, supporting HTML and PDF file types.
Extends: puzzle_base.html
Context Variables:
puzzle: The current puzzle object
Template Blocks:
content: The main content area displaying the puzzle content
puzzle_solution.html
Description: Displays the solution for a puzzle, supporting both HTML and PDF formats.
Extends: hunt_base.html
Context Variables:
puzzle: The puzzle object containing the solution file
Template Blocks:
title_meta_elements: Sets page title to puzzle name with “Solution” suffixcontent: Displays the puzzle solution content based on file type
staff_charts.html
Description: Displays various charts and statistics about puzzle solves, submissions, and hints using Google Charts.
Extends: staff_hunt_base.html
Context Variables:
chart_rows: List of earliest solve data for each puzzlechart_solves_data: Data for puzzle solve status chartchart_submissions_data: Data for puzzle submissions chartchart_hints_data: Data for hints per puzzle chartchart_submissions_by_time_data: Data for submissions over time chartchart_solves_by_time_data: Data for solves over time chart
Template Blocks:
extra_head: Adds Google Charts loaderstaff_content: Displays charts and earliest solves table
staff_feed.html
Description: Displays a real-time feed of hunt events with filtering by team, puzzle, and event type.
Extends: staff_hunt_base.html
Context Variables:
hunt: The current Hunt objectpuzzle_tags: List of selected puzzle IDs for filteringteam_tags: List of selected team IDs for filteringtypes: List of event type optionsdisplay_checkboxes: List of currently selected event typesnum_items: Number of items to display per pagefeed_items: Paginated list of feed events
Template Blocks:
staff_content: Displays feed filters and event items with real-time updates
staff_hints.html
Description: Displays staff interface for managing hint requests with filtering and real-time updates.
Extends: staff_hunt_base.html
Context Variables:
hunt: The current Hunt objecthints: Paginated list of Hint objects
Template Blocks:
staff_content: Displays hint management interface with filters and hint list
staff_hunt_base.html
Description: Base template for staff hunt management pages. Provides a collapsible sidebar with navigation and hunt selection.
Extends: base.html
Context Variables:
hunt: The current Hunt object being managedtmpl_all_hunts: List of all Hunt objects for the hunt selector
Template Blocks:
includes: Adds staff-specific CSS and JS filescontent_wrapper: Provides the main layout with collapsible sidebarstaff_content: Block for staff page-specific contentfooter: Removes default footer
staff_hunt_config.html
Description: Provides an interface for editing hunt configuration using the Ace editor.
Extends: staff_hunt_base.html
Context Variables:
hunt: The current Hunt objectconfig_text: Current hunt configuration text
Template Blocks:
staff_content: Displays configuration editor and puzzle listextra_body: Adds JavaScript for Ace editor initialization and keyboard shortcuts
staff_hunt_puzzles.html
Description: Staff interface for managing and viewing puzzle statistics and files.
Extends: staff_hunt_base.html
Context Variables:
puzzles: List of all Puzzle objects in the huntnum_teams: Total number of teams in the hunt
Template Blocks:
staff_content: The main content area displaying puzzle management interface
staff_hunt_template.html
Description: Staff interface for editing and previewing hunt templates.
Extends: staff_hunt_base.html
Context Variables:
hunt: The current Hunt objecttemplate_text: The current template text contentpuzzle_numbers: List of puzzle numbers for preview functionality
Template Blocks:
staff_content: The main content area with template editor and preview functionalityextra_body: Additional JavaScript for Ace editor initialization
staff_hunts.html
Description: Staff interface for managing and viewing all hunts.
Extends: staff_hunt_base.html
Context Variables:
hunts: List of all Hunt objects
Template Blocks:
staff_content: The main content area displaying hunt management interface
staff_progress.html
Description: Displays a real-time progress board showing teams’ puzzle solving status, hints, and submissions using DataTables.
Extends: staff_hunt_base.html
Context Variables:
hunt: The current Hunt objectpuzzles: List of Puzzle objects in the huntinfo_columns: List of additional information columns to displaypage_size: Optional pagination size for the table
Template Blocks:
includes: Adds DataTables and other required CSS/JS filesstaff_content: Displays the progress board with team and puzzle data
staff_search.html
Description: Provides a search interface for staff to find users and teams.
Extends: staff_hunt_base.html
Context Variables:
hunt: The current Hunt objectquery: The current search query
Template Blocks:
staff_content: Displays search input and results area
team_detail.html
Description: Displays team details and management interface. Shows team members, join code, and team management options.
Extends: allauth/layouts/manage.html
Context Variables:
current_team: The user’s current teamteams: List of user’s previous teamsteam: The team being viewedform: Team management form
Template Blocks:
content: Main content block containing team information and management interface
team_registration.html
Description: Provides interface for creating a new team or joining an existing team.
Extends: info_base.html
Context Variables:
form: Form for creating a new teamcurrent_hunt: The current hunterrors: Error messages from join team attempts
Template Blocks:
title: Sets page title to “Team Registration”content_wrapper: Sets wide layout for the registration formcontent: Displays team creation form and join team interface
updates.html
Description: Displays a list of hunt updates and announcements in chronological order.
Extends: info_base.html
Context Variables:
updates: List of Update objects containing announcements
Template Blocks:
title: Sets page title to “Updates”content: Displays updates in a card-based layout
user_detail.html
Description: Displays and manages user profile details.
Extends: allauth/layouts/manage.html
Context Variables:
user_form: Form for editing user details
Template Blocks:
content: Displays user details form
Components
_bulma_expanded_text_input.html
Description: Renders an expanded text input field with Bulma styling and error handling.
Context Variables:
field: The form field to render
_bulma_rounded_checkbox.html
Description: Renders a rounded checkbox switch with Bulma styling.
Context Variables:
field: The form field to render as a checkbox switch
_feed_item.html
Description: Displays a single feed item with icon, text, and timestamp in a styled box.
Context Variables:
item: The FeedEvent object to displaycompact: Boolean indicating if the item should be displayed in compact mode
_message_container.html
Description: Displays Django messages as Bulma toast notifications.
Context Variables:
messages: List of Django message objects to display
_navbar.html
Description: Main navigation bar with user menu, team selection, and site navigation.
Context Variables:
debug: Boolean indicating if in debug modeuser: The current User objectcurrent_hunt_team: The current Team object for the user in the current huntteam_list: List of Team objects the user belongs tois_staff: Boolean indicating if the user is staff
_paginator.html
Description: Displays a pagination navigation bar with page numbers and ellipsis.
Context Variables:
page_info: Django Page object containing pagination information
Partials
_hint_row.html
Description: Displays a single hint row with request details and response status.
Context Variables:
hint: The Hint object to displaystaff: Boolean indicating if viewing as staffpuzzle: The current Puzzle object
_message_update_user_form.html
Description: Displays user form updates with messages and user display information.
Context Variables:
user: The current User objectuser_form: Form for updating user information
_notification_active_toggle.html
Description: Toggle switch for activating/deactivating notification subscriptions.
Context Variables:
subscription: The NotificationSubscription object to toggle
_notification_table_and_form.html
Description: Displays notification subscriptions table and subscription form.
Context Variables:
subscriptions: List of NotificationSubscription objectsform: Form for creating new notification subscriptions
_puzzle_public_response.html
Description: Displays the response status for a puzzle submission with appropriate styling.
Context Variables:
submission: The PuzzleSubmission object containing response information
_search_results.html
Description: Displays search results for users and teams in the staff interface.
Context Variables:
query: The search query stringusers: List of User objects matching the searchteams: List of Team objects matching the search
_staff_file_list.html
Description: Displays a list of files associated with a puzzle or hunt with management controls.
Context Variables:
parent: The parent object (Puzzle or Hunt) owning the filesparent_type: String indicating the type of parent (‘puzzle’, ‘solution’, or ‘hunt’)
_staff_hint_modal.html
Description: Modal dialog for staff to view and respond to hint requests.
Context Variables:
hint: The Hint object being responded toprevious_hints: List of previous Hint objects for this team and puzzleprevious_submissions: List of previous PuzzleSubmission objects for this team and puzzleform: Form for submitting hint response
_submission_table.html
Description: Displays a table of previous puzzle submissions with real-time updates.
Context Variables:
puzzle: The current Puzzle objectsubmissions: List of PuzzleSubmission objects for this puzzle
_team_name_and_form.html
Description: Displays team name and form for editing team information.
Context Variables:
team: The current Team objectform: Form for editing team information