From 0cd84bb3758d1500f8282f2dc28e38bc25e9fef5 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 23 Jun 2020 22:34:47 +0200 Subject: chg: [ui] improved forms in navbar. --- newspipe/static/js/feed.js | 33 +++-------------------- newspipe/templates/about_more.html | 20 ++++++++------ newspipe/templates/article.html | 54 +++++++++++++++++++------------------- newspipe/templates/home.html | 5 +--- newspipe/templates/layout.html | 38 ++++++++++++--------------- newspipe/templates/login.html | 6 ++--- newspipe/templates/signup.html | 24 ++++++++++------- newspipe/web/views/session_mgmt.py | 4 +-- 8 files changed, 79 insertions(+), 105 deletions(-) diff --git a/newspipe/static/js/feed.js b/newspipe/static/js/feed.js index ccbcd54c..23e509f4 100644 --- a/newspipe/static/js/feed.js +++ b/newspipe/static/js/feed.js @@ -1,7 +1,7 @@ var node = document.getElementById('add-feed-filter-row'); if (node != null) { node.onclick = function() { - document.getElementById('filters-container').innerHTML = + document.getElementById('filters-container').innerHTML = '
' + ' ' + ' ' - + '
'; - } + + ''; + } } var nodes = document.getElementsByClassName('del-feed-filter-row'); @@ -27,30 +27,3 @@ Array.prototype.map.call(nodes, function(node) { node.parentNode.remove(); } }) - - -// Delete a feed -var nodes = document.getElementsByClassName('delete-feed'); -Array.prototype.map.call(nodes, function(node) { - node.onclick = function() { - var r = confirm('You are going to delete this feed.'); - - if (r == true) { - var feed_id = node.parentNode.parentNode.parentNode.getAttribute("data-feed"); - node.parentNode.parentNode.parentNode.remove(); - // $('.feed-menu[data-feed='+feed_id+']').remove(); - - // sends the updates to the server - fetch(API_ROOT + "feed/" + feed_id, { - method: "DELETE", - headers: { - 'Content-Type': 'application/json', - }, - }).then(res => { - console.log("Request complete! response:", res); - }).catch((error) => { - console.error('Error:', error); - });; - } - } -}) diff --git a/newspipe/templates/about_more.html b/newspipe/templates/about_more.html index de034b4b..0df05852 100644 --- a/newspipe/templates/about_more.html +++ b/newspipe/templates/about_more.html @@ -1,13 +1,17 @@ {% extends "layout.html" %} {% block content %}
-

{{ _('Information about this instance') }}

- +
+
+

{{ _('Information about this instance') }}

+
    +
  • {{ _('Newspipe version') }}: {{newspipe_version}}
  • +
  • {{ _('Python version') }}: {{python_version}}
  • +
  • {{ _('Registration') }}: {{registration}}
  • +
  • {{ _('Number of users') }}: {{nb_users}}
  • +
  • {{ _('Content Security Policy') }}: {{content_security_policy}}
  • +
+
+
{% endblock %} diff --git a/newspipe/templates/article.html b/newspipe/templates/article.html index 81705da1..df9eba98 100644 --- a/newspipe/templates/article.html +++ b/newspipe/templates/article.html @@ -1,37 +1,37 @@ {% extends "layout.html" %} {% block content %}
-
-

{{ article.title|safe }}

-

{{ _('from') }} {{ article.source.title }}

- - {% if article.like %} - - {% else %} - - {% endif %} - {% if article.readed %} - - {% else %} - - {% endif %} -
{{ article.date | datetime }}
+
+
+

{{ article.title|safe }}

+

{{ _('from') }} {{ article.source.title }}

+ + {% if article.like %} + + {% else %} + + {% endif %} + {% if article.readed %} + + {% else %} + + {% endif %} +
{{ article.date | datetime }}
+

-
- {{ article.content | safe }} +
+
+ {{ article.content | safe }} +

-
- - - - - - - - - +
+
+ + + +
{% endblock %} diff --git a/newspipe/templates/home.html b/newspipe/templates/home.html index 86563d13..23d4ee37 100644 --- a/newspipe/templates/home.html +++ b/newspipe/templates/home.html @@ -7,7 +7,7 @@
{% if feeds|count == 0 %} -
+

{{ _("You don't have any feeds.") }}

{{ _('Add some') }}, {{ _('or') }} {{ _('upload an OPML file.') }}

@@ -46,7 +46,6 @@ - {% endfor %}
@@ -78,7 +77,6 @@ - {% endfor %}
@@ -108,7 +106,6 @@ - {% endfor %}
diff --git a/newspipe/templates/layout.html b/newspipe/templates/layout.html index 7d2b8c70..115a1cd9 100644 --- a/newspipe/templates/layout.html +++ b/newspipe/templates/layout.html @@ -4,7 +4,7 @@ {% block head %} - + Newspipe{% if head_titles %} - {{ ' - '.join(head_titles) }}{% endif %} @@ -37,37 +37,33 @@ {% endif %}