ttvdrops/templates/twitch/channel_list.html
Joakim Helleśen 428f49879d
All checks were successful
Deploy to Server / deploy (push) Successful in 20s
Add breadcrumb navigation
2026-03-22 05:09:27 +01:00

67 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% load static %}
{% block title %}
Channels
{% endblock title %}
{% block content %}
<h1>Channels</h1>
<div>
<a href="{% url 'twitch:dashboard' %}">Twitch</a> > Channels
</div>
<p>Browse all channels that can participate in drop campaigns</p>
<form method="get" action="{% url 'twitch:channel_list' %}">
<input type="text"
name="search"
value="{{ search_query }}"
placeholder="Search channels..." />
<button type="submit">Search</button>
{% if search_query %}
<a href="{% url 'twitch:channel_list' %}">Clear</a>
{% endif %}
</form>
{% if channels %}
<table>
<thead>
<tr>
<th>Channel</th>
<th>Username</th>
<th>Campaigns</th>
</tr>
</thead>
<tbody>
{% for channel in channels %}
<tr>
<td>
<a href="{% url 'twitch:channel_detail' channel.twitch_id %}">{{ channel.display_name }}</a>
</td>
<td>{{ channel.name }}</td>
<td>{{ channel.campaign_count|default:0 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<!-- Pagination -->
{% if is_paginated %}
<div>
<p>
{% if page_obj.has_previous %}
<a href="?{% if search_query %}search={{ search_query }}&{% endif %}page=1">[first]</a>
<a href="?{% if search_query %}search={{ search_query }}&{% endif %}page={{ page_obj.previous_page_number }}">[previous]</a>
{% endif %}
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
{% if page_obj.has_next %}
<a href="?{% if search_query %}search={{ search_query }}&{% endif %}page={{ page_obj.next_page_number }}">[next]</a>
<a href="?{% if search_query %}search={{ search_query }}&{% endif %}page={{ page_obj.paginator.num_pages }}">[last]</a>
{% endif %}
</p>
<p>Showing {{ page_obj.start_index }} to {{ page_obj.end_index }} of {{ page_obj.paginator.count }} channels</p>
</div>
{% endif %}
{% else %}
{% if search_query %}
<p>No channels match your search query "{{ search_query }}".</p>
{% else %}
<p>No channels found.</p>
{% endif %}
{% endif %}
{% endblock content %}