From 73bd3c0840f706ee619eeae9c1ec0009f3a900d7 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Wed, 5 Jul 2023 06:33:30 +0530 Subject: Add periodic updates, clean up code --- views/add_feed.tpl | 2 +- views/delete.html | 14 -------- views/delete_feed.html | 14 ++++++++ views/index.tpl | 90 +++++++++++++++++++++++++++++++++++--------------- views/manage_feed.tpl | 11 +++--- 5 files changed, 85 insertions(+), 46 deletions(-) delete mode 100644 views/delete.html create mode 100644 views/delete_feed.html (limited to 'views') diff --git a/views/add_feed.tpl b/views/add_feed.tpl index 5fc88fb..2e3008d 100644 --- a/views/add_feed.tpl +++ b/views/add_feed.tpl @@ -7,7 +7,7 @@ - < home + < home % if not get("already_present", False): % if get("after_add", False):

Added feed {{feed_source}}

diff --git a/views/delete.html b/views/delete.html deleted file mode 100644 index 000b733..0000000 --- a/views/delete.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Feed Deleted | TagRSS - - - - -

Feed successfully deleted. Redirecting...

- home - - diff --git a/views/delete_feed.html b/views/delete_feed.html new file mode 100644 index 0000000..da10b3c --- /dev/null +++ b/views/delete_feed.html @@ -0,0 +1,14 @@ + + + + + + Feed Deleted | TagRSS + + + + +

Feed successfully deleted. Redirecting...

+ home + + diff --git a/views/index.tpl b/views/index.tpl index 6ca1518..fe716f0 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -1,60 +1,96 @@ -<% - import time -%> +% import time - View Feeds | TagRSS + View Feed Entries | TagRSS +

TagRSS

- - - - - + + + + + % for i, entry in enumerate(entries): - + <% - dates = [] + date = "" if entry.get("epoch_published", None): - dates.append(time.strftime("%x %X", time.localtime(entry["epoch_published"]))) + date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(entry["epoch_published"])) end if entry.get("epoch_updated", None): - date_updated = time.strftime("%x %X", time.localtime(entry["epoch_updated"])) - if not date_updated in dates: - dates.append(date_updated) - end + date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(entry["epoch_updated"])) end %> - - % end diff --git a/views/manage_feed.tpl b/views/manage_feed.tpl index 86a9c5d..15d7dec 100644 --- a/views/manage_feed.tpl +++ b/views/manage_feed.tpl @@ -7,7 +7,10 @@ - < home + < home + % if get("after_update", False): +

Updated feed details.

+ % end

Manage feed

#TitleDateTagsFeed#TitleDate & Time ({{time.tzname[time.localtime().tm_isdst]}})TagsFeed
{{i + 1}}{{entry["title"]}}{{entry["title"]}} - {{", updated ".join(dates)}} + - % tags = core.get_feed_tags(entry["feed_id"]) - % for i, tag in enumerate(tags): - % if i > 0: - {{", "}} + +
+ % tags = core.get_feed_tags(entry["feed_id"]) + % for i, tag in enumerate(tags): + % if i > 0: + {{", "}} + % end + {{tag}} % end - {{tag}} - % end +
- + +
+ + {{core.get_feed_title(entry["feed_id"])}} +
@@ -16,7 +19,7 @@ - + @@ -48,9 +51,9 @@
- + - \ No newline at end of file + -- cgit v1.2.3-57-g22cb
Source{{feed["source"]}}{{feed["source"]}}
Tags