Skip to content

Make election styling configurable by adding nomination kinds#3030

Merged
JacobCoffee merged 3 commits into
mainfrom
nomination-kinds
Jun 24, 2026
Merged

Make election styling configurable by adding nomination kinds#3030
JacobCoffee merged 3 commits into
mainfrom
nomination-kinds

Conversation

@JacobCoffee

@JacobCoffee JacobCoffee commented Jun 24, 2026

Copy link
Copy Markdown
Member
image image image image

JacobCoffee and others added 3 commits June 24, 2026 10:35
Inject a per-election accent color (from the election's kind) into the
nominations templates via a shared _theme.html partial, so Board vs.
Packaging Council pages are visually distinct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers ElectionKind slug generation, Election.accent_color resolution
(kind set, no kind, kind deleted via SET_NULL), and that the election
detail page renders the accent color from its kind.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 15:38
@JacobCoffee JacobCoffee changed the title Add nomination kind Make election styling configurable by adding nomination kinds Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an admin-managed “election kind” concept to the nominations app so different election categories (e.g., Board vs. Packaging Council) can carry their own accent color and be visually themed consistently across election/nomination/nominee pages.

Changes:

  • Introduces ElectionKind (with accent_color + generated slug) and links Election.kind to it.
  • Adds Election.accent_color convenience property and a reusable _theme.html template partial to apply per-election theming.
  • Adds admin UI support for managing kinds and updates/extends test coverage for theming + model behavior.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/nominations/models.py Adds ElectionKind, Election.kind FK, DEFAULT_ACCENT_COLOR, and Election.accent_color property.
apps/nominations/migrations/0003_election_kind.py Creates ElectionKind table and adds Election.kind field.
apps/nominations/admin.py Registers ElectionKind in admin; enhances ElectionAdmin list display/filtering for kind.
apps/nominations/templates/nominations/_theme.html New shared template partial that emits per-election CSS variables/styles.
apps/nominations/templates/nominations/election_detail.html Includes _theme.html in the head to apply election theming.
apps/nominations/templates/nominations/nominee_list.html Includes _theme.html in the head for themed nominee list pages.
apps/nominations/templates/nominations/nominee_detail.html Includes _theme.html in the head for themed nominee detail pages.
apps/nominations/templates/nominations/nomination_form.html Includes _theme.html in the head for themed nomination create/edit pages.
apps/nominations/templates/nominations/nomination_detail.html Includes _theme.html (explicitly passing nomination.election).
apps/nominations/templates/nominations/nomination_accept_form.html Includes _theme.html in the head for themed nomination accept pages.
apps/nominations/tests/test_models.py Adds tests for ElectionKind slug/accent defaults and Election.accent_color behavior.
apps/nominations/tests/test_views.py Adds view-level tests asserting themed CSS output and default fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JacobCoffee JacobCoffee merged commit 76e0dd1 into main Jun 24, 2026
13 checks passed
@JacobCoffee JacobCoffee deleted the nomination-kinds branch June 24, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants