Files
twitch-drop-notifier/core/templates/partials/game_card.html

82 lines
4.3 KiB
HTML

<div class="card mb-4 shadow-sm" id="game-{{ game.game_id }}">
<div class="row g-0">
<div class="col-md-2">
<img src="{{ game.image_url }}"
alt="{{ game.display_name }}"
class="img-fluid rounded-start"
height="283"
width="212"
loading="lazy">
</div>
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="{{ game.twitch_url }}" class="text-decoration-none">{{ game.display_name }}</a>
</h2>
<div class="mt-auto">
{% for webhook in webhooks %}
<div>
<img src="{{ webhook.avatar }}?size=32"
alt="{{ webhook.name }}"
class="rounded-circle"
height="32"
width="32">
<a href="{{ webhook.url }}" target="_blank">{{ webhook.name }}</a>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-drop-switch">
<label class="form-check-label" for="new-drop-switch">Enable new drop notifications</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="live-drop-switch">
<label class="form-check-label" for="live-drop-switch">Enable live drop notifications</label>
</div>
</div>
{% endfor %}
</div>
{% for campaign in game.campaigns %}
{% if not forloop.first %}<br>{% endif %}
<div class="mt-3">
<h3 class="h6">{{ campaign.name }}</h3>
<p class="mb-2 text-muted">
Ends in: <abbr title="{{ campaign.start_at|date:'l d F H:i' }} - {{ campaign.end_at|date:'l d F H:i e' }}">{{ campaign.end_at|timeuntil }}</abbr>
</p>
{% if campaign.description != campaign.name %}
{% if campaign.description|length > 100 %}
<p>
<a class="btn btn-link p-0 text-muted"
data-bs-toggle="collapse"
href="#collapseDescription{{ campaign.drop_id }}"
role="button"
aria-expanded="false"
aria-controls="collapseDescription{{ campaign.drop_id }}"
aria-label="Show Description">Show
Description</a>
</p>
<div class="collapse" id="collapseDescription{{ campaign.drop_id }}">
<div class="card card-body">{{ campaign.description }}</div>
<br>
</div>
{% else %}
<p>{{ campaign.description }}</p>
{% endif %}
{% endif %}
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-2">
{% for drop in campaign.drops %}
<div class="col d-flex align-items-center position-relative">
<img src="{{ drop.image_url }}"
alt="{{ drop.name }} drop image"
class="img-fluid rounded me-3"
height="50"
width="50"
loading="lazy">
{{ drop.name }}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>