From: Radek Czajka Date: Tue, 9 Dec 2025 14:45:33 +0000 (+0100) Subject: banner fix X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain banner fix --- diff --git a/src/annoy/models.py b/src/annoy/models.py index 097872b40..6af1cc045 100644 --- a/src/annoy/models.py +++ b/src/annoy/models.py @@ -66,7 +66,13 @@ class Banner(models.Model): return self.campaign.image else: return self.image - + + def is_external(self): + return (self.url and + not self.url.startswith('/') and + not self.url.startswith('https://wolnelektury.pl/') + ) + @classmethod def choice(cls, place, request, exemptions=True, book=None): Membership = apps.get_model('club', 'Membership') diff --git a/src/annoy/templates/annoy/banner.html b/src/annoy/templates/annoy/banner.html index bfecd9d36..9a67fcdcb 100644 --- a/src/annoy/templates/annoy/banner.html +++ b/src/annoy/templates/annoy/banner.html @@ -20,7 +20,9 @@ {% if banner.background_color %}background-color: {{ banner.background_color }};{% endif %} "> {% if not banner.action_label %} - + {% endif %}
@@ -34,7 +36,9 @@
{% if banner.action_label %} -
+ {{ banner.action_label }} {% endif %}