Skip to content

Issue #2: Add colour picker to Site Branding admin#7

Merged
andrewyager merged 1 commit intomainfrom
issue/2/impl
Feb 18, 2026
Merged

Issue #2: Add colour picker to Site Branding admin#7
andrewyager merged 1 commit intomainfrom
issue/2/impl

Conversation

@andrewyager
Copy link
Member

Implements #2

Summary

  • Wires up django-unfold's built-in UnfoldAdminColorInputWidget for the primary_color, secondary_color, and accent_color fields in the Site Branding admin
  • Replaces plain text hex inputs with HTML5 colour pickers styled to match the unfold admin theme
  • No model changes, no new dependencies, no custom JavaScript

Changes

  • src/assets/admin.py — Override formfield_for_dbfield() in SiteBrandingAdmin to use the colour picker widget for colour fields
  • src/assets/tests.py — Add TestSiteBrandingColorPickerWidget with 2 tests:
    • test_color_fields_render_as_color_input — verifies type="color" HTML inputs render
    • test_color_picker_saves_value — verifies colour values persist correctly

Test Coverage

  • 2 new tests, all 1335 tests pass
  • Pre-commit hooks (black, isort, flake8) pass

Created by spec-pipeline

Wire up UnfoldAdminColorInputWidget for the primary_color,
secondary_color, and accent_color fields in SiteBrandingAdmin.
This replaces plain text hex inputs with HTML5 colour pickers
styled to match the django-unfold admin theme.

Closes #2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andrewyager andrewyager marked this pull request as ready for review February 18, 2026 13:17
@andrewyager andrewyager merged commit 8516f9f into main Feb 18, 2026
3 checks passed
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.

1 participant

Comments