aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2023-08-02 23:03:49 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2023-08-02 23:03:49 +0000
commitf064e8ffefc841b6dfffdb17f3f407e7558ef8b9 (patch)
treeb3d198605f3b462f4a49c4caba83c9caaa554745 /views
parente59a283db5f850dd791df021e22b599ecc70a824 (diff)
downloadtagrss-f064e8ffefc841b6dfffdb17f3f407e7558ef8b9.tar
tagrss-f064e8ffefc841b6dfffdb17f3f407e7558ef8b9.tar.gz
tagrss-f064e8ffefc841b6dfffdb17f3f407e7558ef8b9.zip
Refactor; more to come
I need to add documentation at some point too.
Diffstat (limited to 'views')
-rw-r--r--views/index.tpl16
-rw-r--r--views/list_feeds.tpl10
2 files changed, 14 insertions, 12 deletions
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):
<tr>
<td>{{i + 1 + offset}}</td>
- <td><a href="{{entry['link']}}">{{entry["title"]}}</a></td>
+ <td><a href="{{entry.link}}">{{entry.title}}</a></td>
<%
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 @@
</td>
<td class="td-tags">
<div>
- % 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 @@
</td>
<td class="td-feed">
<div>
- <a href="/manage_feed?feed={{entry['feed_id']}}" class="no-visited-indication">⚙</a>
- {{referenced_feeds[entry["feed_id"]]["title"]}}
- <small>(</small>{{entry["feed_id"]}}<small>)</small>
+ <a href="/manage_feed?feed={{entry.feed_id}}" class="no-visited-indication">⚙</a>
+ {{referenced_feeds[entry.feed_id].title}}
+ <small>(</small>{{entry.feed_id}}<small>)</small>
</div>
</td>
</tr>
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):
<tr>
<td>{{i + 1 + offset}}</td>
- <td>{{feed["id"]}}</td>
- <td>{{feed["title"]}} (<a href="/?included_feeds={{feed['id']}}" class="no-visited-indication">filter</a>)</td>
+ <td>{{feed.id}}</td>
+ <td>{{feed.title}} (<a href="/?included_feeds={{feed.id}}" class="no-visited-indication">filter</a>)</td>
<td class="td-tags">
<div>
- % for i, tag in enumerate(feed["tags"]):
+ % for i, tag in enumerate(feed.tags):
% if i > 0:
{{", "}}
% end
@@ -67,8 +67,8 @@
% end
</div>
</td>
- <td><a href="{{feed['source']}}" class="no-visited-indication">🔗</a></td>
- <td><a href="/manage_feed?feed={{feed['id']}}" class="no-visited-indication">⚙</a></td>
+ <td><a href="{{feed.source}}" class="no-visited-indication">🔗</a></td>
+ <td><a href="/manage_feed?feed={{feed.id}}" class="no-visited-indication">⚙</a></td>
</tr>
% end
</tbody>