135 lines
7.8 KiB
HTML
135 lines
7.8 KiB
HTML
{% extends "base.html" %}
|
|
{% load custom_filters static time_filters %}
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
{% include "partials/info_box.html" %}
|
|
<!-- Drop Campaigns Section -->
|
|
<section class="drop-campaigns">
|
|
<h2>
|
|
Drop Campaigns -
|
|
<span class="d-inline text-muted">{{ grouped_drops|length }} game{{ grouped_drops|length|pluralize }}</span>
|
|
</h2>
|
|
{% if grouped_drops %}
|
|
{% for game, campaigns in grouped_drops.items %}
|
|
<div class="card mb-4 shadow-sm">
|
|
<div class="row g-0">
|
|
<!-- Game Box Art -->
|
|
<div class="col-md-2">
|
|
{% if game and game.box_art_url %}
|
|
<img src="{{ game.box_art_url }}" alt="{{ game.display_name|default:'Game name unknown' }} box art"
|
|
class="img-fluid rounded-start" height="283" width="212" loading="lazy" />
|
|
{% else %}
|
|
<img src="https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg"
|
|
alt="{% if game %}{{ game.display_name }}{% else %}Unknown Game{% endif %} box art"
|
|
class="img-fluid rounded-start" height="283" width="212" loading="lazy" />
|
|
{% endif %}
|
|
</div>
|
|
<!-- Game Details -->
|
|
<div class="col-md-10">
|
|
<div class="card-body">
|
|
<h2 class="card-title h5">
|
|
{% if game %}
|
|
<a href="{% if game.game_id %}{% url 'game_detail' game.game_id %}{% else %}#{% endif %}"
|
|
class="text-decoration-none">{{ game.display_name|default:'Unknown Game' }}</a>
|
|
{% if game.slug %}
|
|
- <a href="https://www.twitch.tv/directory/category/{{ game.slug }}"
|
|
class="text-decoration-none text-muted">Twitch</a>
|
|
{% endif %}
|
|
{% else %}
|
|
Drops without an associated Game
|
|
{% endif %}
|
|
</h2>
|
|
|
|
{% if campaigns %}
|
|
<div class="mt-4">
|
|
{% for campaign, drops_list in campaigns.items %}
|
|
<div class="card mb-3">
|
|
<div class="card-header bg-secondary bg-opacity-25">
|
|
<h4 class="h6 mb-0"><a
|
|
href="{{ campaign.details_url|default:'#' }}">{{ campaign.name|default:"Unknown Campaign" }}</a>
|
|
</h4>
|
|
<div class="mt-1">
|
|
{% if campaign.details_url != campaign.account_link_url and campaign.account_link_url %}
|
|
<a href="{{ campaign.account_link_url }}" class="text-decoration-none">Link
|
|
Account</a>
|
|
{% endif %}
|
|
</div>
|
|
<p class="mb-0 mt-1 text-muted small">
|
|
{{ campaign.start_at|date:'l d F H:i' }} -
|
|
{{ campaign.end_at|date:'l d F H:i' }} | {{ campaign.end_at|timeuntil }}
|
|
</p>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>Benefit Image</th>
|
|
<th>Drop Name</th>
|
|
<th>Benefit Name</th>
|
|
<th>Required Minutes Watched</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for drop in drops_list %}
|
|
{% if drop.benefits.exists %}
|
|
{% for benefit in drop.benefits.all %}
|
|
<tr>
|
|
<td>
|
|
<img src="{{ benefit.image_asset_url|default:'https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg' }}"
|
|
alt="{{ benefit.name|default:'Unknown Benefit' }}"
|
|
class="img-fluid rounded" height="50" width="50"
|
|
loading="lazy" />
|
|
</td>
|
|
<td>{{ drop.name|default:'Unknown Drop' }}</td>
|
|
<td>
|
|
{{ benefit.name|default:'Unknown Benefit' }}
|
|
</td>
|
|
<td>
|
|
{{ drop.required_minutes_watched|minutes_to_hours }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
<tr>
|
|
<td>
|
|
<img src="https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg"
|
|
alt="{{ drop.name|default:'Unknown Drop' }}"
|
|
class="img-fluid rounded" height="50" width="50"
|
|
loading="lazy" />
|
|
</td>
|
|
<td>{{ drop.name|default:'Unknown Drop' }}</td>
|
|
<td>N/A</td>
|
|
<td>{{ drop.required_minutes_watched|minutes_to_hours|default:'N/A' }}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p class="mt-3 text-muted">No active drops found for this game currently.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<div class="alert alert-info" role="alert">
|
|
There are currently no active Twitch drops found matching the criteria.
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<div class="alert alert-info" role="alert">
|
|
There are currently no active Twitch drops found.
|
|
</div>
|
|
{% endif %}
|
|
</section>
|
|
</div>
|
|
{% endblock content %}
|