First run at adding thumbnailing to images

This commit is contained in:
2023-03-28 14:22:38 -04:00
parent 84070d2806
commit c00343abfe
10 changed files with 84 additions and 41 deletions

View File

@ -1,4 +1,5 @@
{% extends "base_list.html" %}
{% load thumbnail %}
{% block title %}Long Plays{% endblock %}
@ -23,9 +24,13 @@
<dl>
<dt><a href="{{media.get_absolute_url}}">{{media.title}}</a></dt>
{% if media.hltb_cover %}
<dd><a href="{{media.get_absolute_url}}"><img src="{{media.hltb_cover.url}}" width=200 height=200 /></a></dd>
{% thumbnail media.hltb_cover "200" as im %}
<dd><a href="{{media.get_absolute_url}}"><img src="{{im.url}}" width={{im.width}} height={{im.height}} /></a></dd>
{% endthumbnail %}
{% else %}
<dd><a href="{{media.get_absolute_url}}"><img src="{{media.cover.url}}" style="width: 200px; height: 200px; object-fit:cover; " /></a></dd>
{% thumbnail media.cover "200" as im %}
<dd><a href="{{media.get_absolute_url}}"><img src="{{im.url}}" width={{im.width}} height={{im.height}} /></a></dd>
{% endthumbnail %}
{% endif %}
<dd>
{% if media.is_long_play_in_progress %}Playing{% else %}<a type="button" class="btn btn-sm btn-primary" href="{{media.get_start_url}}">Resume</a>{% endif %}
@ -72,12 +77,16 @@
{% for media in completed %}
{% if media.hltb_cover %}
<dl>
<dd><a href="{{media.get_absolute_url}}"><img src="{{media.hltb_cover.url}}" width=200 /></a></dd>
{% thumbnail media.hltb_cover "200" as im %}
<dd><a href="{{media.get_absolute_url}}"><img src="{{im.url}}" width={{im.width}} height={{im.height}} /></a></dd>
{% endthumbnail %}
<dt><a href="{{media.get_absolute_url}}">{{media.title}}</a></dt>
</dl>
{% elif media.cover %}
<dl>
<dd><a href="{{media.get_absolute_url}}"><img src="{{media.cover.url}}" width=200 /></a></dd>
{% thumbnail media.cover "200" as im %}
<dd><a href="{{media.get_absolute_url}}"><img src="{{url}}" width={{im.width}} height={{im.height}} /></a></dd>
{% endthumbnail %}
<dt><a href="{{media.get_absolute_url}}">{{media.title}}</a></dt>
</dl>
{% endif %}