201 lines
12 KiB
HTML
201 lines
12 KiB
HTML
{% extends "home/base.html" %}
|
|
{% block content %}
|
|
{% load static %}
|
|
{% load humanize %}
|
|
<div class="boxed-content">
|
|
<div class="channel-banner">
|
|
<a href="/channel/{{ channel_info.channel_id }}/"><img src="/cache/channels/{{ channel_info.channel_id }}_banner.jpg" alt="channel_banner"></a>
|
|
</div>
|
|
<div id="notifications" data="channel_id"></div>
|
|
<div class="info-box info-box-3">
|
|
<div class="info-box-item">
|
|
<div class="round-img">
|
|
<a href="{% url 'channel_id' channel_info.channel_id %}">
|
|
<img src="/cache/channels/{{ channel_info.channel_id }}_thumb.jpg" alt="channel-thumb">
|
|
</a>
|
|
</div>
|
|
<div>
|
|
<h3><a href="{% url 'channel_id' channel_info.channel_id %}">{{ channel_info.channel_name }}</a></h3>
|
|
{% if channel_info.channel_subs >= 1000000 %}
|
|
<p>Subscribers: {{ channel_info.channel_subs|intword }}</p>
|
|
{% else %}
|
|
<p>Subscribers: {{ channel_info.channel_subs|intcomma }}</p>
|
|
{% endif %}
|
|
{% if channel_info.channel_subscribed %}
|
|
<button class="unsubscribe" type="button" id="{{ channel_info.channel_id }}" onclick="unsubscribe(this.id)" title="Unsubscribe from {{ channel_info.channel_name }}">Unsubscribe</button>
|
|
{% else %}
|
|
<button type="button" id="{{ channel_info.channel_id }}" onclick="subscribe(this.id)" title="Subscribe to {{ channel_info.channel_name }}">Subscribe</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="info-box-item">
|
|
<div>
|
|
<p>Last refreshed: {{ channel_info.channel_last_refresh }}</p>
|
|
{% if channel_info.channel_active %}
|
|
<p>Youtube: <a href="https://www.youtube.com/channel/{{ channel_info.channel_id }}" target="_blank">Active</a></p>
|
|
{% else %}
|
|
<p>Youtube: Deactivated</p>
|
|
{% endif %}
|
|
<button onclick="deleteConfirm()" id="delete-item">Delete Channel</button>
|
|
<div class="delete-confirm" id="delete-button">
|
|
<span>Delete {{ channel_info.channel_name }} including all videos? </span><button class="danger-button" onclick="deleteChannel(this)" data-id="{{ channel_info.channel_id }}">Delete</button> <button onclick="cancelDelete()">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="info-box-item">
|
|
<div>
|
|
{% if channel_info.channel_views >= 1000000 %}
|
|
<p>Channel views: {{ channel_info.channel_views|intword }}</p>
|
|
{% elif channel_info.channel_views > 0 %}
|
|
<p>Channel views: {{ channel_info.channel_views|intcomma }}</p>
|
|
{% endif %}
|
|
{% if max_hits %}
|
|
<p>Total Videos archived: {{ max_hits }}</p>
|
|
<p>Watched: <button title="Mark all videos from {{ channel_info.channel_name }} as watched" type="button" id="watched-button" data-id="{{ channel_info.channel_id }}" onclick="isWatchedButton(this)">Mark as watched</button></p>
|
|
{% endif %}
|
|
<button {% if channel_info.channel_overwrites %} class="danger-button"{% endif %} onclick="showOverwrite()" title="Overwrite settings for channel {{ channel_info.channel_name }}">Configure</button>
|
|
<a href="/playlist/?search={{ channel_info.channel_id }}" title="Show all playlists belonging to {{ channel_info.channel_name }}"><button>Show Playlists</button></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="overwrite-form" class="info-box{% if not channel_info.channel_overwrites %} hidden-overwrite{% endif %}">
|
|
<div class="info-box-item">
|
|
<form class="overwrite-form" action="/channel/{{ channel_info.channel_id }}/" method="POST">
|
|
{% csrf_token %}
|
|
<div class="overwrite-form-item">
|
|
<p>Download format: <span class="settings-current">
|
|
{% if channel_info.channel_overwrites.download_format %}
|
|
{{ channel_info.channel_overwrites.download_format }}
|
|
{% else %}
|
|
False
|
|
{% endif %}</span></p>
|
|
{{ channel_overwrite_form.download_format }}<br>
|
|
</div>
|
|
<div class="overwrite-form-item">
|
|
<p>Auto delete watched videos after x days: <span class="settings-current">
|
|
{% if channel_info.channel_overwrites.autodelete_days %}
|
|
{{ channel_info.channel_overwrites.autodelete_days }}
|
|
{% else %}
|
|
False
|
|
{% endif %}</span></p>
|
|
{{ channel_overwrite_form.autodelete_days }}<br>
|
|
</div>
|
|
<div class="overwrite-form-item">
|
|
<p>Index playlists: <span class="settings-current">
|
|
{% if channel_info.channel_overwrites.index_playlists %}
|
|
{{ channel_info.channel_overwrites.index_playlists }}
|
|
{% else %}
|
|
False
|
|
{% endif %}</span></p>
|
|
{{ channel_overwrite_form.index_playlists }}<br>
|
|
</div>
|
|
<div class="overwrite-form-item">
|
|
<p>Enable <a href="https://sponsor.ajay.app/" target="_blank">SponsorBlock</a>: <span class="settings-current">
|
|
{% if channel_info.channel_overwrites.integrate_sponsorblock %}
|
|
{{ channel_info.channel_overwrites.integrate_sponsorblock }}
|
|
{% elif channel_info.channel_overwrites.integrate_sponsorblock == False %}
|
|
Disabled
|
|
{% else %}
|
|
False
|
|
{% endif %}</span></p>
|
|
{{ channel_overwrite_form.integrate_sponsorblock }}<br>
|
|
</div>
|
|
<button type="submit">Save Channel Overwrites</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% if channel_info.channel_description %}
|
|
<div class="info-box-item description-box">
|
|
<p>Description: <button onclick="textReveal()" id="text-reveal-button">Show</button></p>
|
|
<div id="text-reveal" class="description-text">
|
|
{{ channel_info.channel_description|linebreaks }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="boxed-content {% if view_style == "grid" %}boxed-{{ grid_items }}{% endif %}">
|
|
<div class="view-controls">
|
|
<div class="toggle">
|
|
<span>Hide watched videos:</span>
|
|
<div class="toggleBox">
|
|
<input id="hide_watched" onclick="toggleCheckbox(this)" type="checkbox" {% if hide_watched %}checked{% endif %}>
|
|
{% if not hide_watched %}
|
|
<label for="" class="ofbtn">Off</label>
|
|
{% else %}
|
|
<label for="" class="onbtn">On</label>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="sort">
|
|
<div id="hidden-form">
|
|
<span>Sort by:</span>
|
|
<select name="sort" id="sort" onchange="sortChange(this.value)">
|
|
<option value="published" {% if sort_by == "published" %}selected{% endif %}>date published</option>
|
|
<option value="downloaded" {% if sort_by == "downloaded" %}selected{% endif %}>date downloaded</option>
|
|
<option value="views" {% if sort_by == "views" %}selected{% endif %}>views</option>
|
|
<option value="likes" {% if sort_by == "likes" %}selected{% endif %}>likes</option>
|
|
</select>
|
|
<select name="sord-order" id="sort-order" onchange="sortChange(this.value)">
|
|
<option value="asc" {% if sort_order == "asc" %}selected{% endif %}>asc</option>
|
|
<option value="desc" {% if sort_order == "desc" %}selected{% endif %}>desc</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="view-icons">
|
|
<img src="{% static 'img/icon-sort.svg' %}" alt="sort-icon" onclick="showForm()" id="animate-icon">
|
|
{% if view_style == "grid" %}
|
|
<div class="grid-count">
|
|
<span>{{ grid_items }}</span>
|
|
<img src="{% static 'img/icon-add.svg' %}" onclick="changeGridItems(this)" data-value="{{ grid_items|add:"1"}}" alt="grid plus row">
|
|
<img src="{% static 'img/icon-substract.svg' %}" onclick="changeGridItems(this)" data-value="{{ grid_items|add:"-1"}}" alt="grid minus row">
|
|
</div>
|
|
{% endif %}
|
|
<img src="{% static 'img/icon-gridview.svg' %}" onclick="changeView(this)" data-origin="home" data-value="grid" alt="grid view">
|
|
<img src="{% static 'img/icon-listview.svg' %}" onclick="changeView(this)" data-origin="home" data-value="list" alt="list view">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="player" class="player-wrapper"></div>
|
|
<div class="boxed-content {% if view_style == "grid" %}boxed-{{ grid_items }}{% endif %}">
|
|
<div class="video-list {{ view_style }} {% if view_style == "grid" %}grid-{{ grid_items }}{% endif %}">
|
|
{% if results %}
|
|
{% for video in results %}
|
|
<div class="video-item {{ view_style }}">
|
|
<a href="#player" data-id="{{ video.source.youtube_id }}" onclick="createPlayer(this)">
|
|
<div class="video-thumb-wrap {{ view_style }}">
|
|
<div class="video-thumb">
|
|
<img src="/cache/{{ video.source.vid_thumb_url }}" alt="video-thumb">
|
|
{% if video.source.player.progress %}
|
|
<div class="video-progress-bar" id="progress-{{ video.source.youtube_id }}" style="width: {{video.source.player.progress}}%;"></div>
|
|
{% else %}
|
|
<div class="video-progress-bar" id="progress-{{ video.source.youtube_id }}" style="width: 0%;"></div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="video-play">
|
|
<img src="{% static 'img/icon-play.svg' %}" alt="play-icon">
|
|
</div>
|
|
</div>
|
|
</a>
|
|
<div class="video-desc {{ view_style }}">
|
|
<div class="video-desc-player" id="video-info-{{ video.source.youtube_id }}">
|
|
{% if video.source.player.watched %}
|
|
<img src="{% static 'img/icon-seen.svg' %}" alt="seen-icon" data-id="{{ video.source.youtube_id }}" data-status="watched" onclick="updateVideoWatchStatus(this)" class="watch-button" title="Mark as unwatched">
|
|
{% else %}
|
|
<img src="{% static 'img/icon-unseen.svg' %}" alt="unseen-icon" data-id="{{ video.source.youtube_id }}" data-status="unwatched" onclick="updateVideoWatchStatus(this)" class="watch-button" title="Mark as watched">
|
|
{% endif %}
|
|
<span>{{ video.source.published }} | {{ video.source.player.duration_str }}</span>
|
|
</div>
|
|
<div>
|
|
<a class="video-more" href="{% url 'video' video.source.youtube_id %}"><h2>{{ video.source.title }}</h2></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<h2>No videos found...</h2>
|
|
<p>Try going to the <a href="{% url 'downloads' %}">downloads page</a> to start the scan and download tasks.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" src="{% static 'progress.js' %}"></script>
|
|
{% endblock content %} |