80 lines
3.8 KiB
HTML
80 lines
3.8 KiB
HTML
{% extends "home/base.html" %}
|
|
{% load static %}
|
|
{% block content %}
|
|
<div class="title-bar">
|
|
<h1>Downloads</h1>
|
|
</div>
|
|
<div id="downloadMessage"></div>
|
|
<div id="downloadControl"></div>
|
|
<div class="info-box info-box-3 padding-box">
|
|
<div class="icon-text">
|
|
<img id="rescan-icon" onclick="rescanPending()" src="{% static 'img/icon-rescan.svg' %}" alt="rescan-icon">
|
|
<p>Rescan subscriptions</p>
|
|
</div>
|
|
<div class="icon-text">
|
|
<img id="download-icon" onclick="dlPending()" src="{% static 'img/icon-download.svg' %}" alt="download-icon">
|
|
<p>Start download</p>
|
|
</div>
|
|
<div class="icon-text">
|
|
<img id="add-icon" onclick="showForm()" src="{% static 'img/icon-add.svg' %}" alt="add-icon">
|
|
<p>Add to download queue</p>
|
|
<div class="show-form">
|
|
<form id='hidden-form' action="/downloads/" method="post">
|
|
{% csrf_token %}
|
|
<textarea rows="4" placeholder="Enter Video Urls or IDs here..." id="vid-url" name="vid-url"></textarea>
|
|
<button type="submit">Add to download queue</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="padding-box">
|
|
<span>Change show / hide ignored only </span><span class="settings-current">{{ filter_view }}</span>
|
|
<select name="showIgnoredOnly" id="showIgnoredOnly" onchange="showIgnoredOnly(this.value)">
|
|
<option value="" disabled selected> -- change -- </option>
|
|
<option value="ignore">show ignored only</option>
|
|
<option value="pending">show download queue</option>
|
|
</select>
|
|
</div>
|
|
<div class="view-icons">
|
|
<img src="{% static 'img/icon-gridview.svg' %}" onclick="changeView(this)" data-origin="downloads" data-value="grid" alt="grid view">
|
|
<img src="{% static 'img/icon-listview.svg' %}" onclick="changeView(this)" data-origin="downloads" data-value="list" alt="list view">
|
|
</div>
|
|
{% if filter_view == "ignore" %}
|
|
<h2>Ignored from download</h2>
|
|
{% else %}
|
|
<h2>Download queue</h2>
|
|
{% endif %}
|
|
<h3>Total videos: {{ max_hits }}</h3>
|
|
<div class="dl-list {{ view_style }}">
|
|
{% if all_video_hits %}
|
|
{% for video in all_video_hits %}
|
|
<div class="dl-item {{ view_style }}" id="dl-{{ video.youtube_id }}">
|
|
<div class="dl-thumb {{ view_style }}">
|
|
<img src="{{ video.vid_thumb_url }}" alt="video_thumb">
|
|
</div>
|
|
<div class="dl-desc {{ view_style }}">
|
|
{% if filter_view == "ignore" %}
|
|
<h3>Ignore: {{ video.title }}</h3>
|
|
{% else %}
|
|
<h3>Download: {{ video.title }}</h3>
|
|
{% endif %}
|
|
{% if video.channel_indexed %}
|
|
<a href="{% url 'channel_id' video.channel_id %}">{{ video.channel_name }}</a>
|
|
{% else %}
|
|
<span>{{ video.channel_name }}</span>
|
|
{% endif %}
|
|
<p>Published: {{ video.published }} | Duration: {{ video.duration }} | {{ video.youtube_id }}</p>
|
|
{% if filter_view == "ignore" %}
|
|
<button data-id="{{ video.youtube_id }}" onclick="forgetIgnore(this)">Forget</button>
|
|
<button data-id="{{ video.youtube_id }}" onclick="addSingle(this)">Add to queue</button>
|
|
{% else %}
|
|
<button data-id="{{ video.youtube_id }}" onclick="toIgnore(this)">Ignore</button>
|
|
<button id="{{ video.youtube_id }}" data-id="{{ video.youtube_id }}" onclick="downloadNow(this)">Download now</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
<script type="text/javascript" src="{% static 'progress.js' %}"></script>
|
|
{% endblock content %} |