From 4eabca458c931aff11af6e00387aa541279b2c6b Mon Sep 17 00:00:00 2001 From: George Katsikas <giorgakis.katsikas@gmail.com> Date: Wed, 3 Apr 2024 09:59:09 +0200 Subject: [PATCH] change hx_sponsors to use organization.logo --- .../scipost/templates/scipost/_hx_sponsors.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scipost_django/scipost/templates/scipost/_hx_sponsors.html b/scipost_django/scipost/templates/scipost/_hx_sponsors.html index 31ca59a26..baf59eca9 100644 --- a/scipost_django/scipost/templates/scipost/_hx_sponsors.html +++ b/scipost_django/scipost/templates/scipost/_hx_sponsors.html @@ -3,17 +3,15 @@ <div id="sponsor-logos" class="d-flex sp-swap" + style="max-height: 250px;" hx-get="{% url 'scipost:_hx_sponsors' %}?dt={{ request.GET.dt|increment_dt }}" hx-push-url="false" hx-trigger="every {{ request.GET.dt|increment_dt }}s" hx-swap="outerHTML swap:1s"> - {% for source in sponsor.logos.all %} - <picture class="mx-auto d-flex flex-column"> - <source type="{{ source.mimetype }}" - srcset="{{ source.image.url }} {{ source.width }}" /> - - <img class="rounded" + {% if sponsor.logo %} + <picture class="mx-auto d-flex flex-column w-100"> + <img class="p-2 {{ sponsor.css_class }}" style="max-height: 100%; max-width: 100%; object-fit: contain" @@ -24,10 +22,10 @@ <a href="{{ sponsor.get_absolute_url }}" target="_blank">{{ sponsor.name }}</a> </caption> </picture> - {% empty %} + {% else %} <h2 class="mt-2"> <a href="{{ sponsor.get_absolute_url }}" target="_blank">{{ sponsor.name }}</a> </h2> - {% endfor %} + {% endif %} </div> -- GitLab