From f064e8ffefc841b6dfffdb17f3f407e7558ef8b9 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Thu, 3 Aug 2023 04:33:49 +0530 Subject: Refactor; more to come I need to add documentation at some point too. --- views/index.tpl | 16 +++++++++------- views/list_feeds.tpl | 10 +++++----- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'views') diff --git a/views/index.tpl b/views/index.tpl index 0145a4e..1851531 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -100,12 +100,14 @@ % for i, entry in enumerate(entries): {{i + 1 + offset}} - {{entry["title"]}} + {{entry.title}} <% local_date = "" utc_date = "" - epoch = entry.get("epoch_published") - epoch = entry.get("epoch_updated", epoch) + epoch = entry.epoch_updated + if not epoch: + epoch = entry.epoch_published + end if epoch: local_date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(epoch)) utc_date = time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime(epoch)) @@ -116,7 +118,7 @@
- % tags = referenced_feeds[entry["feed_id"]]["tags"] + % tags = referenced_feeds[entry.feed_id].tags % for i, tag in enumerate(tags): % if i > 0: {{", "}} @@ -127,9 +129,9 @@
- - {{referenced_feeds[entry["feed_id"]]["title"]}} - ({{entry["feed_id"]}}) + + {{referenced_feeds[entry.feed_id].title}} + ({{entry.feed_id}})
diff --git a/views/list_feeds.tpl b/views/list_feeds.tpl index 2b4bd6d..65432a3 100644 --- a/views/list_feeds.tpl +++ b/views/list_feeds.tpl @@ -55,11 +55,11 @@ % for i, feed in enumerate(feeds): {{i + 1 + offset}} - {{feed["id"]}} - {{feed["title"]}} (filter) + {{feed.id}} + {{feed.title}} (filter)
- % for i, tag in enumerate(feed["tags"]): + % for i, tag in enumerate(feed.tags): % if i > 0: {{", "}} % end @@ -67,8 +67,8 @@ % end
- 🔗 - + 🔗 + % end -- cgit v1.2.3-57-g22cb