Add a club event-background photo, shown in black & white on event heroes
New Club.event_background, uploaded from the identity page. Individual events have no photo of their own (an established, deliberate scope decision for this build), so this is the one club-wide stand-in for the photo the design canvas's own hero mockups call for -- shown under the same dark gradient the hero already used, filtered to grayscale so it never fights the club's own brand colours. Falls back to the existing plain dark background when nothing's uploaded. Applied to both event hero treatments: M2's own event-detail screen (the "big black thing" this was reported against) and Home's "next up" card. The image and gradient are separate absolutely-positioned layers behind a z-10 content wrapper, not a filter on the card itself, so the grayscale treatment never touches the text/buttons drawn on top of it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
19
club/migrations/0031_club_event_background.py
Normal file
19
club/migrations/0031_club_event_background.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 6.0.6 on 2026-08-21 16:10
|
||||
|
||||
import club.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('club', '0030_club_legal_address_club_legal_city_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='club',
|
||||
name='event_background',
|
||||
field=models.ImageField(blank=True, help_text='A generic background photo for event screens in the mobile app, shown in black & white under a dark gradient. Without one, a plain dark background is used.', upload_to=club.models.club_event_background_path, verbose_name='event background'),
|
||||
),
|
||||
]
|
||||
@@ -32,6 +32,10 @@ def club_logo_path(instance: Club, filename: str) -> str:
|
||||
return f"clubs/{instance.slug}/{filename}"
|
||||
|
||||
|
||||
def club_event_background_path(instance: Club, filename: str) -> str:
|
||||
return f"clubs/{instance.slug}/event-background/{filename}"
|
||||
|
||||
|
||||
class Club(UUIDModel):
|
||||
class SportType(models.TextChoices):
|
||||
"""Which sport this club plays. Only two options for now -- expand this as
|
||||
@@ -68,6 +72,16 @@ class Club(UUIDModel):
|
||||
validators=[FileExtensionValidator(allowed_extensions=["png", "jpg", "jpeg", "gif", "webp", "svg"])],
|
||||
help_text=_("Shown on the club's own pages. Without one, the club's initials are used."),
|
||||
)
|
||||
event_background = models.ImageField(
|
||||
_("event background"),
|
||||
upload_to=club_event_background_path,
|
||||
blank=True,
|
||||
# A real photo, unlike logo -- shown in black & white under a dark
|
||||
# gradient (see mobile/templates/mobile/event_detail.html), so an
|
||||
# ImageField (Pillow-validated, unlike logo's plain FileField) is the
|
||||
# right fit here: this is never a vector crest.
|
||||
help_text=_("A generic background photo for event screens in the mobile app, shown in black & white under a dark gradient. Without one, a plain dark background is used."),
|
||||
)
|
||||
primary_color = models.CharField(
|
||||
_("primary colour"),
|
||||
max_length=7,
|
||||
|
||||
Reference in New Issue
Block a user