2021-09-05 17:10:14 +00:00
|
|
|
{% extends "home/base.html" %}
|
|
|
|
{% load static %}
|
|
|
|
{% load humanize %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="title-bar">
|
|
|
|
<h1>Channels</h1>
|
|
|
|
</div>
|
2021-09-15 14:09:46 +00:00
|
|
|
<div class="info-box info-box-2">
|
|
|
|
<div class="icon-text">
|
|
|
|
<img id="add-icon" onclick="showForm()" src="{% static 'img/icon-add.svg' %}" alt="add-icon">
|
|
|
|
<p>Subscribe to Channels</p>
|
|
|
|
<div class="show-form">
|
|
|
|
<form id="hidden-form" action="/channel/" method="post">
|
|
|
|
{% csrf_token %}
|
|
|
|
<textarea rows="3" placeholder="Input channel ID, channel URL or Video of a channel" id="subscribe" name="subscribe"></textarea>
|
|
|
|
<button type="submit">Subscribe</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-09-15 14:09:46 +00:00
|
|
|
<div class="search-form icon-text">
|
|
|
|
<div class="search-icon">
|
|
|
|
<img src="{% static 'img/icon-search.svg' %}" alt="search-icon" onclick="showSearch()">
|
|
|
|
<p>Search Channels</p>
|
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
<form onSubmit="return channelRedirect();" id="search-box">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input name="videoSearch" list="resultBox" type="text" id="searchInput" autocomplete="off" oninput="searchChannels(this.value)">
|
|
|
|
<datalist id="resultBox">
|
|
|
|
</datalist>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-10-02 12:39:02 +00:00
|
|
|
<div class="view-icons">
|
|
|
|
<img src="{% static 'img/icon-gridview.svg' %}" onclick="changeView(this)" data-origin="channel" data-value="grid" alt="grid view">
|
|
|
|
<img src="{% static 'img/icon-listview.svg' %}" onclick="changeView(this)" data-origin="channel" data-value="list" alt="list view">
|
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
<div class="padding-box">
|
|
|
|
<h2>Total matching channels: {{ max_hits }}</h2>
|
|
|
|
<span>Change show / hide subscribed only </span><span class="settings-current">{{ show_subed_only }}</span>
|
|
|
|
<select name="watched" id="watched" onchange="showSubscribedOnly(this.value)">
|
|
|
|
<option value="" disabled selected> -- change -- </option>
|
|
|
|
<option value="0">show all channels</option>
|
|
|
|
<option value="1">show subscribed channels only</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2021-10-02 12:39:02 +00:00
|
|
|
<div class="channel-list {{ view_style }}">
|
2021-09-05 17:10:14 +00:00
|
|
|
{% if channels %}
|
|
|
|
{% for channel in channels %}
|
2021-10-02 12:39:02 +00:00
|
|
|
<div class="channel-item {{ view_style }}">
|
2021-09-05 17:10:14 +00:00
|
|
|
{% if channel.source.channel_banner_url %}
|
2021-10-02 12:39:02 +00:00
|
|
|
<div class="channel-banner {{ view_style }}">
|
2021-09-05 17:10:14 +00:00
|
|
|
<a href="{% url 'channel_id' channel.source.channel_id %}">
|
|
|
|
<img src="/cache/channels/{{ channel.source.channel_id }}_banner.jpg" alt="{{ channel.source.channel_id }}-banner">
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-10-02 12:39:02 +00:00
|
|
|
<div class="info-box info-box-2 {{ view_style }}">
|
2021-09-05 17:10:14 +00:00
|
|
|
<div class="info-box-item">
|
|
|
|
<div class="round-img">
|
|
|
|
<a href="{% url 'channel_id' channel.source.channel_id %}">
|
|
|
|
<img src="/cache/channels/{{ channel.source.channel_id }}_thumb.jpg" alt="channel-thumb">
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h3><a href="{% url 'channel_id' channel.source.channel_id %}">{{ channel.source.channel_name }}</a></h3>
|
|
|
|
{% if channel.source.channel_subs >= 1000000 %}
|
|
|
|
<p>Subscribers: {{ channel.source.channel_subs|intword }}</p>
|
|
|
|
{% else %}
|
|
|
|
<p>Subscribers: {{ channel.source.channel_subs|intcomma }}</p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="info-box-item">
|
|
|
|
<div>
|
|
|
|
<p>Last refreshed: {{ channel.source.channel_last_refresh }}</p>
|
|
|
|
<p>Subscribed:
|
|
|
|
{% if channel.source.channel_subscribed %}
|
|
|
|
<button type="button" id="{{ channel.source.channel_id }}" onclick="unsubscribe(this.id)" title="Unsubscribe from {{ channel.source.channel_name }}">Unsubscribe</button>
|
|
|
|
{% else %}
|
|
|
|
false
|
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<h2>No channels found...</h2>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endblock content %}
|