aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2023-07-05 01:03:30 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2023-07-05 01:03:30 +0000
commit73bd3c0840f706ee619eeae9c1ec0009f3a900d7 (patch)
treeed32d5d673828acb89bfd8604c6aa76b42161ce2 /views
parenta4d9ba11381295380314a1f749c1ae1eeb6773f2 (diff)
downloadtagrss-73bd3c0840f706ee619eeae9c1ec0009f3a900d7.tar
tagrss-73bd3c0840f706ee619eeae9c1ec0009f3a900d7.tar.gz
tagrss-73bd3c0840f706ee619eeae9c1ec0009f3a900d7.zip
Add periodic updates, clean up code
Diffstat (limited to 'views')
-rw-r--r--views/add_feed.tpl2
-rw-r--r--views/delete_feed.html (renamed from views/delete.html)2
-rw-r--r--views/index.tpl90
-rw-r--r--views/manage_feed.tpl11
4 files changed, 72 insertions, 33 deletions
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 @@
<link href="/static/styles/main.css" rel="stylesheet">
</head>
<body>
- <a href="/">&lt; home</a>
+ <a href="/" class="no-visited-indication">&lt; home</a>
% if not get("already_present", False):
% if get("after_add", False):
<p><em>Added feed {{feed_source}}</em></p>
diff --git a/views/delete.html b/views/delete_feed.html
index 000b733..da10b3c 100644
--- a/views/delete.html
+++ b/views/delete_feed.html
@@ -9,6 +9,6 @@
</head>
<body>
<p>Feed successfully deleted. Redirecting...</p>
- <a href="/">home</a>
+ <a href="/" class="no-visited-indication">home</a>
</body>
</html>
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>View Feeds | TagRSS</title>
+ <title>View Feed Entries | TagRSS</title>
<link href="/static/styles/main.css" rel="stylesheet">
+ <style>
+ table {
+ table-layout: fixed;
+ }
+ th#th-num {
+ width: 2.5%;
+ }
+ th#th-title {
+ width: 45%;
+ }
+ th#th-datetime {
+ width: 12.5%;
+ }
+ th#th-tag {
+ width: 20%;
+ }
+ td.td-tag > div {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: auto;
+ white-space: nowrap;
+ }
+ th#th-feed {
+ width: 20%;
+ }
+ td.td-feed > div {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: auto;
+ white-space: nowrap;
+ }
+ </style>
</head>
<body>
<h1>TagRSS</h1>
<nav>
- <p><a href="/add_feed">Add feed</a></p>
+ <p><a href="/add_feed" class="no-visited-indication">Add feed</a></p>
</nav>
<table>
<thead>
<tr>
- <th>#</th>
- <th>Title</th>
- <th>Date</th>
- <th>Tags</th>
- <th>Feed</th>
+ <th id="th-num">#</th>
+ <th id="th-title">Title</th>
+ <th id="th-datetime">Date & Time ({{time.tzname[time.localtime().tm_isdst]}})</th>
+ <th id="th-tags">Tags</th>
+ <th id="th-feed">Feed</th>
</tr>
</thead>
<tbody>
% for i, entry in enumerate(entries):
<tr>
<td>{{i + 1}}</td>
- <td><a href="{{entry["link"]}}">{{entry["title"]}}</a></td>
+ <td><a href="{{entry['link']}}">{{entry["title"]}}</a></td>
<%
- 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
%>
<td>
- {{", updated ".join(dates)}}
+ <time datetime="{{date}}">{{date}}</time>
</td>
- <td>
- % tags = core.get_feed_tags(entry["feed_id"])
- % for i, tag in enumerate(tags):
- % if i > 0:
- {{", "}}
+ <td class="td-tag">
+ <div>
+ % tags = core.get_feed_tags(entry["feed_id"])
+ % for i, tag in enumerate(tags):
+ % if i > 0:
+ {{", "}}
+ % end
+ <span class="tag">{{tag}}</span>
% end
- <span class="tag">{{tag}}</span>
- % end
+ </div>
</td>
- <td>
- <a href="/manage_feed?feed={{entry["feed_id"]}}">⚙</a>
+ <td class="td-feed">
+ <div>
+ <a href="/manage_feed?feed={{entry['feed_id']}}" class="no-visited-indication">⚙</a>
+ {{core.get_feed_title(entry["feed_id"])}}
+ </div>
</td>
</tr>
% 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 @@
<link href="/static/styles/main.css" rel="stylesheet">
</head>
<body>
- <a href="/">&lt; home</a>
+ <a href="/" class="no-visited-indication">&lt; home</a>
+ % if get("after_update", False):
+ <p><em>Updated feed details.</em></p>
+ % end
<h1>Manage feed</h1>
<table>
<tr>
@@ -16,7 +19,7 @@
</tr>
<tr>
<th>Source</th>
- <td>{{feed["source"]}}</td>
+ <td><a href="{{feed['source']}}" class="no-visited-indication">{{feed["source"]}}</a></td>
</tr>
<tr>
<th>Tags</th>
@@ -48,9 +51,9 @@
<input type="submit" value="Update" name="update_feed">
</form>
<hr>
- <form method="post" action="/delete">
+ <form method="post" action="/delete_feed">
<input type="number" name="id" value="{{feed['id']}}" style="display: none;">
<input type="submit" value="Delete" name="delete_feed">
</form>
</body>
-</html> \ No newline at end of file
+</html>