Add support for modern image formats (WebP and AVIF) and implement image conversion commands
This commit is contained in:
parent
7128f19b9e
commit
477bb753ae
15 changed files with 629 additions and 93 deletions
|
|
@ -1,5 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load image_tags %}
|
||||
{% block title %}
|
||||
{{ campaign.clean_name }}
|
||||
{% endblock title %}
|
||||
|
|
@ -20,10 +21,7 @@
|
|||
{% endfor %}
|
||||
<!-- Campaign image -->
|
||||
{% if campaign.image_best_url %}
|
||||
<img height="160"
|
||||
width="160"
|
||||
src="{{ campaign.image_best_url }}"
|
||||
alt="{{ campaign.name }}" />
|
||||
{% picture campaign.image_best_url alt=campaign.name width=160 height=160 %}
|
||||
{% endif %}
|
||||
<!-- Campaign description -->
|
||||
<p>{{ campaign.description|linebreaksbr }}</p>
|
||||
|
|
@ -106,24 +104,13 @@
|
|||
<td>
|
||||
{% for benefit in drop.drop.benefits.all %}
|
||||
{% if benefit.image_asset_url %}
|
||||
<img height="160"
|
||||
width="160"
|
||||
loading="lazy"
|
||||
style="object-fit: cover;
|
||||
margin-right: 3px"
|
||||
src="{{ benefit.image_best_url|default:benefit.image_asset_url }}"
|
||||
alt="{{ benefit.name }}" />
|
||||
{% picture benefit.image_best_url|default:benefit.image_asset_url alt=benefit.name width=160 height=160 style="object-fit: cover; margin-right: 3px" %}
|
||||
{% endif %}
|
||||
{% if benefit.distribution_type == "BADGE" and drop.awarded_badge %}
|
||||
<div style="margin-top: 6px; font-size: 0.9em;">
|
||||
<strong>Awards Badge:</strong>
|
||||
<a href="{% url 'twitch:badge_set_detail' set_id=drop.awarded_badge.badge_set.set_id %}">
|
||||
<img src="{{ drop.awarded_badge.image_url_2x }}"
|
||||
alt="{{ drop.awarded_badge.title }} badge"
|
||||
height="24"
|
||||
width="24"
|
||||
style="vertical-align: middle;
|
||||
margin-right: 4px" />
|
||||
{% picture drop.awarded_badge.image_url_2x alt=drop.awarded_badge.title|add:" badge" width=24 height=24 style="vertical-align: middle; margin-right: 4px" %}
|
||||
{{ drop.awarded_badge.title }}
|
||||
</a>
|
||||
{% if drop.awarded_badge.description %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue