From 41575bf4a97f19845ce0a49fec80a7b3414057a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20Ny=CC=81vlt?= Date: Wed, 16 Aug 2023 18:52:24 +0200 Subject: [PATCH] Refactor templates --- .editorconfig | 15 ++++ view/templates/about.html | 63 ++++++---------- view/templates/base.html | 25 ++++++ view/templates/feeds.html | 56 ++++++-------- view/templates/index.html | 134 +++++++++++++++------------------ view/templates/parts/head.html | 7 -- 6 files changed, 145 insertions(+), 155 deletions(-) create mode 100644 .editorconfig create mode 100644 view/templates/base.html delete mode 100644 view/templates/parts/head.html diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e6d4a33 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{html,py}] +indent_style = tab +indent_size = 4 + +[*.html] +indent_style = tab +indent_size = 2 diff --git a/view/templates/about.html b/view/templates/about.html index d906a45..4859a28 100644 --- a/view/templates/about.html +++ b/view/templates/about.html @@ -1,42 +1,23 @@ - - +{% extends "base.html" %} - - {% include 'parts/head.html' %} - - - - - - -
-
-

Headliner

-

Headliner is monitoring rss feeds of czech news websites for changes in article headlines. Just - because it might be interesting.

-

See the source code, but be aware that it's not too nice. - Feel free to improve it.

-

If you want to access the raw data collected by this tool, you can download the full archive from our git

-
-
- - {% include 'parts/footer.html' %} - - - \ No newline at end of file +{% block body %} +
+
+

Headliner

+

+ Headliner is monitoring rss feeds of czech news websites for changes in + article headlines. Just because it might be interesting. +

+

+ See the source code, + but be aware that it's not too nice. Feel free to improve it. +

+

+ If you want to access the raw data collected by this tool, you can + download the full archive from our git +

+
+
+{% endblock body %} diff --git a/view/templates/base.html b/view/templates/base.html new file mode 100644 index 0000000..23bb11c --- /dev/null +++ b/view/templates/base.html @@ -0,0 +1,25 @@ + + + + + + Headliner + + + + + + {% block body %}{% endblock %} + {% include 'parts/footer.html' %} + + diff --git a/view/templates/feeds.html b/view/templates/feeds.html index 8c15342..dd4457c 100644 --- a/view/templates/feeds.html +++ b/view/templates/feeds.html @@ -1,35 +1,27 @@ - - +{% extends "base.html" %} - - {% include 'parts/head.html' %} - +{% block body %} +
+
+ + + + + + + + + + {% for feed in feeds %} + + + + - - -
-
-
NameRSS/Atom URLUnique tag
{{ feed.feed_name }}{{ feed.rss_source | urlize(target="_blank") }}{{ feed.unique_tag }}
- - - - - - - - - {% for feed in feeds %} - - - - - - {% endfor %} - -
NameRSS/Atom URLUnique tag
{{ feed.feed_name }}{{ feed.rss_source | urlize(target="_blank") }}{{ feed.unique_tag }}
-
+ {% endfor %} + + +
- {% include 'parts/footer.html' %} - - - \ No newline at end of file + +{% endblock body %} diff --git a/view/templates/index.html b/view/templates/index.html index 4dea652..79f3f0f 100644 --- a/view/templates/index.html +++ b/view/templates/index.html @@ -1,80 +1,64 @@ - - +{% extends "base.html" %} - - {% include 'parts/head.html' %} - - - - - - -
+{% block body %} +
- - + +
-
- - - - - - - - - - - - {% for diff in diffs %} - - - - - - - - {% endfor %} - -
Detection timeSourceDiffOriginalChanged
{{ diff.diff_time }}{{ diff.feed_name }}{{ diff.diff_html|safe }} - {{ diff.title_orig|truncate(15) }} - {{ diff.title_orig }} - - {{ diff.title_new|truncate(15) }} - {{ diff.title_new}} -
-
-
-
-
- {{ pagination.links }} -
-
- {{ pagination.info }} -
-
-
-
- {% include 'parts/footer.html' %} - - - +
+ + + + + + + + + + + + {% for diff in diffs %} + + + + + + + + {% endfor %} + +
Detection timeSourceDiffOriginalChanged
{{ diff.diff_time }} + {{ diff.feed_name }} + {{ diff.diff_html|safe }} + {{ diff.title_orig|truncate(15) }} + {{ diff.title_orig }} + + {{ diff.title_new|truncate(15) }} + {{ diff.title_new}} +
+
+
+
+
{{ pagination.links }}
+
{{ pagination.info }}
+
+
+
+{% endblock body %} diff --git a/view/templates/parts/head.html b/view/templates/parts/head.html deleted file mode 100644 index 50739f8..0000000 --- a/view/templates/parts/head.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Headliner - - - - \ No newline at end of file