diff --git a/scipost_django/scipost/templates/scipost/_hx_sponsors.html b/scipost_django/scipost/templates/scipost/_hx_sponsors.html index 31ca59a26b624f211e1b5740e4ea7554692398b1..baf59eca9fb8bc31caa7ecc338c26618b12d32a3 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>