All checks were successful
Deploy to Server / deploy (push) Successful in 10s
177 lines
9.6 KiB
HTML
177 lines
9.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}
|
|
{{ channel.display_name }} - Channel Details
|
|
{% endblock title %}
|
|
{% block content %}
|
|
<!-- Channel Title -->
|
|
<h1>{{ channel.display_name }}</h1>
|
|
{% if channel.display_name != channel.name %}
|
|
<p>
|
|
Username: <code>{{ channel.name }}</code>
|
|
</p>
|
|
{% endif %}
|
|
<!-- Twitch Stream Embed -->
|
|
<iframe src="https://player.twitch.tv/?channel={{ channel.name }}&parent={{ request.get_host }}&muted=false"
|
|
height="480"
|
|
width="100%"
|
|
allowfullscreen
|
|
style="max-width: 854px;
|
|
border: none">
|
|
</iframe>
|
|
<!-- Channel Info -->
|
|
<p>Channel ID: {{ channel.twitch_id }}</p>
|
|
{% if active_campaigns %}
|
|
<h5>Active Campaigns</h5>
|
|
<table>
|
|
<tbody>
|
|
{% for campaign in active_campaigns %}
|
|
<!-- Campaign {{ campaign.name }} ({{ campaign.twitch_id }}) -->
|
|
<tr>
|
|
<td>
|
|
<a href="{% url 'twitch:campaign_detail' campaign.twitch_id %}">{{ campaign.clean_name }}</a>
|
|
{% if campaign.time_based_drops.all %}
|
|
<!-- If the campaign has time-based drops, show the benefits in a nested div -->
|
|
<div>
|
|
<!-- swag swag swag {{campaign.sorted_benefits}} -->
|
|
{% for benefit in campaign.sorted_benefits %}
|
|
<!-- Benefit {{ benefit.name }} ({{ benefit.twitch_id }}) -->
|
|
<!-- {{ benefit.image_best_url }} -->
|
|
<span title="{{ benefit.name }}">
|
|
{% if benefit.image_best_url or benefit.image_asset_url %}
|
|
<!-- Show the benefit image if available -->
|
|
<img src="{{ benefit.image_best_url|default:benefit.image_asset_url }}"
|
|
alt="{{ benefit.name }}"
|
|
width="24"
|
|
height="24"
|
|
style="display: inline-block;
|
|
margin-right: 4px;
|
|
vertical-align: middle" />
|
|
{% endif %}
|
|
{{ benefit.name }}
|
|
</span>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if campaign.game %}
|
|
<!-- If the campaign has an associated game, show the game name with a link to the game detail page -->
|
|
<a href="{% url 'twitch:game_detail' campaign.game.twitch_id %}">
|
|
{{ campaign.game.display_name|default:campaign.game.name }}
|
|
</a>
|
|
{% else %}
|
|
Unknown Game
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<span title="Ends on {{ campaign.end_at|date:'M d, Y H:i' }}">Ends in {{ campaign.end_at|timeuntil }}</span>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
{% if upcoming_campaigns %}
|
|
<!-- If there are upcoming campaigns, show them in a separate section -->
|
|
<h5>Upcoming Campaigns</h5>
|
|
<table>
|
|
<tbody>
|
|
{% for campaign in upcoming_campaigns %}
|
|
<!-- Campaign {{ campaign.name }} ({{ campaign.twitch_id }}) -->
|
|
<tr>
|
|
<td>
|
|
<a href="{% url 'twitch:campaign_detail' campaign.twitch_id %}">{{ campaign.clean_name }}</a>
|
|
{% if campaign.time_based_drops.all %}
|
|
<!-- If the campaign has time-based drops, show the benefits in a nested div -->
|
|
<div>
|
|
{% for benefit in campaign.sorted_benefits %}
|
|
<!-- Benefit {{ benefit.name }} ({{ benefit.twitch_id }}) -->
|
|
<span title="{{ benefit.name }}">
|
|
{% if benefit.image_best_url or benefit.image_asset_url %}
|
|
<!-- Show the benefit image if available -->
|
|
<img src="{{ benefit.image_best_url|default:benefit.image_asset_url }}"
|
|
alt="{{ benefit.name }}"
|
|
width="24"
|
|
height="24"
|
|
style="display: inline-block;
|
|
margin-right: 4px;
|
|
vertical-align: middle" />
|
|
{% endif %}
|
|
{{ benefit.name }}
|
|
</span>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if campaign.game %}
|
|
<!-- If the campaign has an associated game, show the game name with a link to the game detail page -->
|
|
<a href="{% url 'twitch:game_detail' campaign.game.twitch_id %}">
|
|
{{ campaign.game.display_name|default:campaign.game.name }}
|
|
</a>
|
|
{% else %}
|
|
Unknown Game
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<span title="Starts on {{ campaign.start_at|date:'M d, Y H:i' }}">Starts in {{ campaign.start_at|timeuntil }}</span>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
{% if expired_campaigns %}
|
|
<!-- If there are expired campaigns, show them in a separate section -->
|
|
<h5>Past Campaigns</h5>
|
|
<table>
|
|
<tbody>
|
|
{% for campaign in expired_campaigns %}
|
|
<!-- Campaign {{ campaign.name }} ({{ campaign.twitch_id }}) -->
|
|
<tr>
|
|
<td>
|
|
<a href="{% url 'twitch:campaign_detail' campaign.twitch_id %}">{{ campaign.clean_name }}</a>
|
|
{% if campaign.time_based_drops.all %}
|
|
<!-- If the campaign has time-based drops, show the benefits in a nested div -->
|
|
<div>
|
|
{% for benefit in campaign.sorted_benefits %}
|
|
<!-- Benefit {{ benefit.name }} ({{ benefit.twitch_id }}) -->
|
|
<span title="{{ benefit.name }}">
|
|
{% if benefit.image_best_url or benefit.image_asset_url %}
|
|
<img src="{{ benefit.image_best_url|default:benefit.image_asset_url }}"
|
|
alt="{{ benefit.name }}"
|
|
width="24"
|
|
height="24"
|
|
style="display: inline-block;
|
|
margin-right: 4px;
|
|
vertical-align: middle" />
|
|
{% endif %}
|
|
{{ benefit.name }}
|
|
</span>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if campaign.game %}
|
|
<!-- If the campaign has an associated game, show the game name with a link to the game detail page -->
|
|
<a href="{% url 'twitch:game_detail' campaign.game.twitch_id %}">
|
|
{{ campaign.game.display_name|default:campaign.game.name }}
|
|
</a>
|
|
{% else %}
|
|
Unknown Game
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<span title="Ended on {{ campaign.end_at|date:'M d, Y H:i' }}">{{ campaign.end_at|timesince }} ago</span>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
{% if not active_campaigns and not upcoming_campaigns and not expired_campaigns %}
|
|
<p>No campaigns found for this channel.</p>
|
|
{% endif %}
|
|
{{ channel_data|safe }}
|
|
{% endblock content %}
|