2021-09-05 17:10:14 +00:00
|
|
|
{% extends "home/base.html" %}
|
|
|
|
{% load static %}
|
|
|
|
{% load humanize %}
|
|
|
|
{% block content %}
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="boxed-content">
|
|
|
|
<div class="title-bar">
|
|
|
|
<h1>Channels</h1>
|
|
|
|
</div>
|
|
|
|
<div id="notifications" data="channel"></div>
|
|
|
|
<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 %}
|
|
|
|
{{ subscribe_form }}
|
|
|
|
<button type="submit">Subscribe</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="search-form icon-text">
|
|
|
|
<div class="search-icon">
|
|
|
|
<img src="{% static 'img/icon-search.svg' %}" alt="search-icon" onclick="showSearch()">
|
|
|
|
<p>Search your Channels</p>
|
|
|
|
</div>
|
|
|
|
<form onSubmit="return channelRedirect();" id="search-box">
|
2021-12-05 13:26:39 +00:00
|
|
|
{% csrf_token %}
|
2021-12-06 11:05:25 +00:00
|
|
|
{{ search_form }}
|
|
|
|
<datalist id="resultBox">
|
|
|
|
</datalist>
|
2021-12-05 13:26:39 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="view-controls">
|
|
|
|
<div class="toggle">
|
|
|
|
<span>Show only subscribed channels:</span>
|
|
|
|
<div class="toggleBox">
|
|
|
|
<input
|
|
|
|
id="show_subed_only" onclick="toggleCheckbox(this)" type="checkbox"
|
|
|
|
{% if show_subed_only %}
|
|
|
|
checked
|
|
|
|
{% endif %}
|
|
|
|
>
|
|
|
|
<label for="" class="onbtn">On</label>
|
|
|
|
<label for="" class="ofbtn">Off</label>
|
|
|
|
</div>
|
2021-09-15 14:09:46 +00:00
|
|
|
</div>
|
2021-12-06 11:05:25 +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">
|
2021-10-03 11:44:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
<h2>Total matching channels: {{ max_hits }}</h2>
|
|
|
|
<div class="channel-list {{ view_style }}">
|
|
|
|
{% if channels %}
|
|
|
|
{% for channel in channels %}
|
|
|
|
<div class="channel-item {{ view_style }}">
|
|
|
|
<div class="channel-banner {{ view_style }}">
|
|
|
|
<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>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="info-box info-box-2 {{ view_style }}">
|
|
|
|
<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>
|
2021-12-18 09:56:32 +00:00
|
|
|
{% if channel.source.channel_subscribed %}
|
2021-12-16 11:28:52 +00:00
|
|
|
<button class="unsubscribe" type="button" id="{{ channel.source.channel_id }}" onclick="unsubscribe(this.id)" title="Unsubscribe from {{ channel.source.channel_name }}">Unsubscribe</button>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% else %}
|
|
|
|
<button type="button" id="{{ channel.source.channel_id }}" onclick="subscribe(this.id)" title="Subscribe to {{ channel.source.channel_name }}">Subscribe</button>
|
2021-12-18 09:56:32 +00:00
|
|
|
{% endif %}
|
2021-12-06 11:05:25 +00:00
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<h2>No channels found...</h2>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-12-05 09:42:33 +00:00
|
|
|
<script type="text/javascript" src="{% static 'progress.js' %}"></script>
|
2021-09-05 17:10:14 +00:00
|
|
|
{% endblock content %}
|