mirror of
https://github.com/chibicitiberiu/ytsm.git
synced 2024-02-24 05:43:31 +00:00
Implemented import from file functionality.
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
{% extends 'YtManagerApp/controls/modal.html' %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block modal_title %}
|
||||
Import subscriptions
|
||||
{% endblock modal_title %}
|
||||
|
||||
{% block modal_content %}
|
||||
<form action="{% url 'modal_import_subscriptions' %}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
{{ block.super }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal_body %}
|
||||
{% crispy form %}
|
||||
{% endblock modal_body %}
|
||||
|
||||
{% block modal_footer %}
|
||||
<input class="btn btn-primary" type="submit" value="Import">
|
||||
<input class="btn btn-secondary" type="button" value="Cancel" data-dismiss="modal" aria-label="Cancel">
|
||||
{% endblock modal_footer %}
|
@ -29,19 +29,27 @@
|
||||
<div class="col-3">
|
||||
{# Tree toolbar #}
|
||||
<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" >
|
||||
<div class="btn-group mr-2" role="group">
|
||||
<button id="btn_create_sub" type="button" class="btn btn-light"
|
||||
data-toggle="tooltip" title="Add subscription...">
|
||||
<span class="typcn typcn-plus" aria-hidden="true"></span>
|
||||
</button>
|
||||
<button id="btn_create_folder" type="button" class="btn btn-secondary">
|
||||
<button id="btn_create_folder" type="button" class="btn btn-light"
|
||||
data-toggle="tooltip" title="Add folder...">
|
||||
<span class="typcn typcn-folder-add" aria-hidden="true"></span>
|
||||
</button>
|
||||
<button id="btn_import" type="button" class="btn btn-light"
|
||||
data-toggle="tooltip" title="Import from file...">
|
||||
<span class="typcn typcn-document-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" >
|
||||
<div class="btn-group mr-2" role="group">
|
||||
<button id="btn_edit_node" type="button" class="btn btn-light"
|
||||
data-toggle="tooltip" title="Edit selection">
|
||||
<span class="typcn typcn-edit" aria-hidden="true"></span>
|
||||
</button>
|
||||
<button id="btn_delete_node" type="button" class="btn btn-secondary" >
|
||||
<button id="btn_delete_node" type="button" class="btn btn-light"
|
||||
data-toggle="tooltip" title="Delete selection">
|
||||
<span class="typcn typcn-trash" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -162,6 +162,9 @@ function videos_Submit(e)
|
||||
///
|
||||
$(document).ready(function ()
|
||||
{
|
||||
// Initialize tooltips
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
tree_Initialize();
|
||||
|
||||
// Subscription toolbar
|
||||
@ -175,6 +178,11 @@ $(document).ready(function ()
|
||||
modal.setSubmitCallback(tree_Refresh);
|
||||
modal.loadAndShow();
|
||||
});
|
||||
$("#btn_import").on("click", function () {
|
||||
let modal = new AjaxModal("{% url 'modal_import_subscriptions' %}");
|
||||
modal.setSubmitCallback(tree_Refresh);
|
||||
modal.loadAndShow();
|
||||
});
|
||||
$("#btn_edit_node").on("click", treeNode_Edit);
|
||||
$("#btn_delete_node").on("click", treeNode_Delete);
|
||||
|
||||
|
Reference in New Issue
Block a user