From db20b602d5a4d0e5868a03aa75827b68da97e268 Mon Sep 17 00:00:00 2001 From: Christian Henriksen Date: Thu, 22 Jan 2026 01:30:38 +0100 Subject: [PATCH] Add top banner with live streaming link - Use new 'camp.is_in_progress' property as condition for showing the banner. - Move navbar into new 'fixed-top' div with the banner. --- src/camps/models.py | 5 + src/templates/base.html | 237 +++++++++++++++++++++------------------- 2 files changed, 131 insertions(+), 111 deletions(-) diff --git a/src/camps/models.py b/src/camps/models.py index 4772879b3..d92a2417e 100644 --- a/src/camps/models.py +++ b/src/camps/models.py @@ -240,6 +240,11 @@ def logo_large(self) -> str: def logo_large_svg(self) -> str: return f"img/{self.slug}/logo/{self.slug}-logo-large.svg" + @property + def is_in_progress(self) -> bool: + today = timezone.now().date() + return True if today in self.camp_days else False + def get_days(self, camppart): """Returns a list of DateTimeTZRanges representing the days during the specified part of the camp.""" if not hasattr(self, camppart): diff --git a/src/templates/base.html b/src/templates/base.html index 43243307c..75bb370ae 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -70,127 +70,142 @@ {% block body %} + {% if camp.is_in_progress %} +
+ {% else %}
- + +
{% if camp %}