Make index view faster

This commit is contained in:
2024-08-13 05:37:53 +02:00
parent edbdc9aa32
commit 041b2ddb95
11 changed files with 146 additions and 257 deletions

View File

@ -1,8 +1,8 @@
<div class="card mb-4 shadow-sm" id="game-{{ game.twitch_id }}">
<div class="card mb-4 shadow-sm" id="#{{ game.twitch_id }}">
<div class="row g-0">
<div class="col-md-2">
<img src="https://static-cdn.jtvnw.net/ttv-boxart/{{ game.twitch_id }}_IGDB.jpg"
alt="{{ game.display_name }}"
alt="{{ game.name }} box art"
class="img-fluid rounded-start"
height="283"
width="212"
@ -21,11 +21,18 @@
{% if not forloop.first %}<br>{% endif %}
<div class="mt-3">
<h3 class="h6">{{ campaign.name }}</h3>
{% if campaign.details_url == campaign.account_link_url %}
<a href="{{ campaign.details_url }}" class="text-decoration-none">Details</a>
{% else %}
<a href="{{ campaign.details_url }}" class="text-decoration-none">Details</a>
|
<a href="{{ campaign.account_link_url }}" class="text-decoration-none">Link Account</a>
{% endif %}
<p class="mb-2 text-muted">
Ends in: <abbr title="{{ campaign.starts_at|date:'l d F H:i' }} - {{ campaign.ends_at|date:'l d F H:i e' }}">{{ campaign.ends_at|timeuntil }}</abbr>
</p>
{% if campaign.description != campaign.name %}
{% if campaign.description|length > 200 %}
{% if campaign.description|length > 300 %}
<p>
<a class="btn btn-link p-0 text-muted"
data-bs-toggle="collapse"