Big refactor

This commit is contained in:
2018-10-11 01:43:50 +03:00
parent 291da16461
commit ae77251883
42 changed files with 4311 additions and 264 deletions

View File

@ -21,18 +21,18 @@
<div class="btn-toolbar" role="toolbar" aria-label="Subscriptions toolbar">
<div class="btn-group btn-group-sm mr-2" role="group">
<button id="btn_create_sub" type="button" class="btn btn-secondary" >
<i class="material-icons" aria-hidden="true">add</i>
<span class="typcn typcn-plus" aria-hidden="true"></span>
</button>
<button id="btn_create_folder" type="button" class="btn btn-secondary">
<i class="material-icons" aria-hidden="true">create_new_folder</i>
<span class="typcn typcn-folder-add" aria-hidden="true"></span>
</button>
</div>
<div class="btn-group btn-group-sm mr-2" role="group">
<button id="btn_edit_node" type="button" class="btn btn-secondary" >
<i class="material-icons" aria-hidden="true">edit</i>
<span class="typcn typcn-edit" aria-hidden="true"></span>
</button>
<button id="btn_delete_node" type="button" class="btn btn-secondary" >
<i class="material-icons" aria-hidden="true">delete</i>
<span class="typcn typcn-trash" aria-hidden="true"></span>
</button>
</div>
</div>
@ -41,4 +41,10 @@
<p>Loading...</p>
</div>
{% endblock %}
{% block detail %}
<div id="main_detail">
</div>
{% endblock %}

View File

@ -279,10 +279,10 @@ function tree_Initialize()
},
types : {
folder : {
icon : "material-icons material-folder"
icon : "typcn typcn-folder"
},
sub : {
icon : "material-icons material-person",
icon : "typcn typcn-user",
max_depth : 0
}
},
@ -314,6 +314,13 @@ function tree_ValidateChange(operation, node, parent, position, more)
function tree_OnSelectionChanged(e, data)
{
node = data.instance.get_selected(true)[0];
$.post("{% url 'ajax_list_videos' %}", {
type: node.type,
id: node.id.replace('folder', '').replace('sub', ''),
csrfmiddlewaretoken: '{{ csrf_token }}'
}).done(function (result) {
$("#main_detail").html(result);
});
}
///

View File

@ -7,7 +7,7 @@
<title>{% block title %}YouTube Subscription Manager{% endblock %}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="{% static 'YtManagerApp/import/typicons/typicons.min.css' %}" />
<link rel="stylesheet" href="{% static 'YtManagerApp/css/style.css' %}">
{% block stylesheets %}
{% endblock %}

View File

@ -0,0 +1,38 @@
<div class="video-gallery container-fluid">
<div class="row">
{% for video in videos %}
<div class="card-wrapper col-12 col-sm-6 col-lg-4 col-xl-3 d-flex align-items-stretch">
<div class="card mx-auto">
<img class="card-img-top" src="{{ video.icon_best }}" alt="Thumbnail">
<div class="card-body">
<h5 class="card-title">
{% if not video.watched %}
<sup class="badge badge-primary">New</sup>
{% endif %}
{{ video.name }}
</h5>
<p class="card-text">{{ video.description | truncatechars:120 }}</p>
</div>
<div class="card-footer dropdown show">
<span class="typcn typcn-eye {{ video.watched | yesno:"video-icon-yes,video-icon-no" }}"
title="{{ video.watched | yesno:"Watched,Not watched" }}"></span>
<span class="typcn typcn-download {{ video.downloaded_path | yesno:"video-icon-yes,,video-icon-no" }}"
title="{{ video.downloaded_path | yesno:"Downloaded,,Not downloaded" }}"></span>
<small class="text-muted">{{ video.publish_date }}</small>
<a class="card-more float-right text-muted"
href="#" role="button" id="dropdownMenuLink"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="typcn typcn-cog"></span></a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="#">Mark {{ video.watched | yesno:"not watched,watched" }}</a>
{% if video.downloaded_path %}
<a class="dropdown-item" href="#">Delete downloaded</a>
{% else %}
<a class="dropdown-item" href="#">Download</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>