From 59a766b0fe9a41df6540c94fc93a0344f8da6b4f Mon Sep 17 00:00:00 2001 From: Tiberiu Chibici Date: Sat, 3 Nov 2018 14:43:23 +0200 Subject: [PATCH] Implemented import from file functionality. --- .../controls/subscriptions_import_modal.html | 22 ++++ .../templates/YtManagerApp/index.html | 20 +++- .../templates/YtManagerApp/js/index.js | 8 ++ app/YtManagerApp/urls.py | 4 +- .../utils/subscription_file_parser.py | 104 ++++++++++++++++++ app/YtManagerApp/views/index.py | 104 +++++++++++++++++- 6 files changed, 253 insertions(+), 9 deletions(-) create mode 100644 app/YtManagerApp/templates/YtManagerApp/controls/subscriptions_import_modal.html create mode 100644 app/YtManagerApp/utils/subscription_file_parser.py diff --git a/app/YtManagerApp/templates/YtManagerApp/controls/subscriptions_import_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/subscriptions_import_modal.html new file mode 100644 index 0000000..6707e47 --- /dev/null +++ b/app/YtManagerApp/templates/YtManagerApp/controls/subscriptions_import_modal.html @@ -0,0 +1,22 @@ +{% extends 'YtManagerApp/controls/modal.html' %} +{% load crispy_forms_tags %} + +{% block modal_title %} + Import subscriptions +{% endblock modal_title %} + +{% block modal_content %} +
+ {{ block.super }} +
+{% endblock %} + +{% block modal_body %} + {% crispy form %} +{% endblock modal_body %} + +{% block modal_footer %} + + +{% endblock modal_footer %} \ No newline at end of file diff --git a/app/YtManagerApp/templates/YtManagerApp/index.html b/app/YtManagerApp/templates/YtManagerApp/index.html index cf158ee..6ec5490 100644 --- a/app/YtManagerApp/templates/YtManagerApp/index.html +++ b/app/YtManagerApp/templates/YtManagerApp/index.html @@ -29,19 +29,27 @@
{# Tree toolbar #}