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 sharing
  • extra_meta_elements: Block for additional meta elements
  • favicon: Block for the favicon
  • base_includes: Block for including base CSS/JS files
  • bulma_includes: Block for including Bulma-specific CSS/JS files
  • includes: Block for template-specific includes
  • extra_head: Block for additional head content
  • content_wrapper: Block containing the main content wrapper structure
  • content: Block for the main content of the page
  • footer: Block containing the footer content
  • extra_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 object
  • formset: 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 object
  • team: The current team object (optional)
  • title: Optional page title override

Template Blocks:

  • title_meta_elements: Overrides title meta elements to include hunt name
  • base_includes: Adds hunt-specific CSS and custom hunt CSS if available
  • bulma_includes: Removes default Bulma includes
  • content_wrapper: Adds SSE-based live updates for hunt content
  • content: Block for hunt-specific content
  • footer: 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 width
  • content: 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 object
  • team: The current Team object
  • puzzles: List of all Puzzle objects in the hunt
  • solved: 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 CSS
  • content_wrapper: Provides a centered content layout with configurable width
  • content: 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 displayed
  • ruleset: List of LeaderboardRule objects defining the columns and ranking rules
  • team_data: List of Team objects with their ranking data

Template Blocks:

  • title_meta_elements: Sets page title to include hunt name
  • content_wrapper: Sets wide layout for the leaderboard
  • content: 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 objects
  • event_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 name
  • base_includes: Adds JavaScript for answer checking
  • content: 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 object
  • form: 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 object
  • is_prepuzzle: Template tag result indicating if this is a prepuzzle

Template Blocks:

  • title_meta_elements: Sets page title to puzzle name
  • content_wrapper: Adds puzzle info box section
  • content: 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 for
  • team: The current team object
  • hints: List of previous Hint objects for this puzzle
  • status: PuzzleStatus object for this team and puzzle

Template Blocks:

  • title_meta_elements: Sets page title to puzzle name with “Hints” suffix
  • content_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 object
  • team: The current Team object
  • form: Form for submitting puzzle answers
  • updates: 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” suffix
  • content: 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 puzzle
  • chart_solves_data: Data for puzzle solve status chart
  • chart_submissions_data: Data for puzzle submissions chart
  • chart_hints_data: Data for hints per puzzle chart
  • chart_submissions_by_time_data: Data for submissions over time chart
  • chart_solves_by_time_data: Data for solves over time chart

Template Blocks:

  • extra_head: Adds Google Charts loader
  • staff_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 object
  • puzzle_tags: List of selected puzzle IDs for filtering
  • team_tags: List of selected team IDs for filtering
  • types: List of event type options
  • display_checkboxes: List of currently selected event types
  • num_items: Number of items to display per page
  • feed_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 object
  • hints: 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 managed
  • tmpl_all_hunts: List of all Hunt objects for the hunt selector

Template Blocks:

  • includes: Adds staff-specific CSS and JS files
  • content_wrapper: Provides the main layout with collapsible sidebar
  • staff_content: Block for staff page-specific content
  • footer: 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 object
  • config_text: Current hunt configuration text

Template Blocks:

  • staff_content: Displays configuration editor and puzzle list
  • extra_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 hunt
  • num_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 object
  • template_text: The current template text content
  • puzzle_numbers: List of puzzle numbers for preview functionality

Template Blocks:

  • staff_content: The main content area with template editor and preview functionality
  • extra_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 object
  • puzzles: List of Puzzle objects in the hunt
  • info_columns: List of additional information columns to display
  • page_size: Optional pagination size for the table

Template Blocks:

  • includes: Adds DataTables and other required CSS/JS files
  • staff_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 object
  • query: 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 team
  • teams: List of user’s previous teams
  • team: The team being viewed
  • form: 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 team
  • current_hunt: The current hunt
  • errors: Error messages from join team attempts

Template Blocks:

  • title: Sets page title to “Team Registration”
  • content_wrapper: Sets wide layout for the registration form
  • content: 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 display
  • compact: 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 mode
  • user: The current User object
  • current_hunt_team: The current Team object for the user in the current hunt
  • team_list: List of Team objects the user belongs to
  • is_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 display
  • staff: Boolean indicating if viewing as staff
  • puzzle: 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 object
  • user_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 objects
  • form: 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 string
  • users: List of User objects matching the search
  • teams: 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 files
  • parent_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 to
  • previous_hints: List of previous Hint objects for this team and puzzle
  • previous_submissions: List of previous PuzzleSubmission objects for this team and puzzle
  • form: 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 object
  • submissions: 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 object
  • form: Form for editing team information