diff options
author | Arjun Satarkar <me@arjunsatarkar.net> | 2023-07-04 15:55:53 +0000 |
---|---|---|
committer | Arjun Satarkar <me@arjunsatarkar.net> | 2023-07-04 15:55:53 +0000 |
commit | a4d9ba11381295380314a1f749c1ae1eeb6773f2 (patch) | |
tree | a6e727c6d2c766b1db81c1ab8fc4d73119c0008a /views | |
parent | ed597cc711919d75a48940b7ee21d76e9b261e13 (diff) | |
download | tagrss-a4d9ba11381295380314a1f749c1ae1eeb6773f2.tar tagrss-a4d9ba11381295380314a1f749c1ae1eeb6773f2.tar.gz tagrss-a4d9ba11381295380314a1f749c1ae1eeb6773f2.zip |
Add feed modification and deletion
Diffstat (limited to 'views')
-rw-r--r-- | views/add_feed.tpl | 1 | ||||
-rw-r--r-- | views/delete.html | 14 | ||||
-rw-r--r-- | views/index.tpl | 8 | ||||
-rw-r--r-- | views/manage_feed.tpl | 56 |
4 files changed, 75 insertions, 4 deletions
diff --git a/views/add_feed.tpl b/views/add_feed.tpl index 3c54ffb..5fc88fb 100644 --- a/views/add_feed.tpl +++ b/views/add_feed.tpl @@ -23,7 +23,6 @@ <input type="text" placeholder="Tags" name="tags"> <span class="hover-help" tabindex="0" title="Space separated. Backslashes escape spaces.">🛈</span> </div> - <br> <input type="submit" value="Add"> </form> </body> diff --git a/views/delete.html b/views/delete.html new file mode 100644 index 0000000..000b733 --- /dev/null +++ b/views/delete.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Feed Deleted | TagRSS</title> + <link href="/static/styles/main.css" rel="stylesheet"> + <meta http-equiv="refresh" content="5; url=/" /> +</head> +<body> + <p>Feed successfully deleted. Redirecting...</p> + <a href="/">home</a> +</body> +</html> diff --git a/views/index.tpl b/views/index.tpl index 6ff4ab4..6ca1518 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -1,3 +1,6 @@ +<% + import time +%> <!DOCTYPE html> <html lang="en"> <head> @@ -27,7 +30,6 @@ <td>{{i + 1}}</td> <td><a href="{{entry["link"]}}">{{entry["title"]}}</a></td> <% - import time dates = [] if entry.get("epoch_published", None): dates.append(time.strftime("%x %X", time.localtime(entry["epoch_published"]))) @@ -43,7 +45,7 @@ {{", updated ".join(dates)}} </td> <td> - % tags = tagrss_backend.get_feed_tags(entry["feed_id"]) + % tags = core.get_feed_tags(entry["feed_id"]) % for i, tag in enumerate(tags): % if i > 0: {{", "}} @@ -52,7 +54,7 @@ % end </td> <td> - <a href="/manage_feeds?feed={{entry["feed_id"]}}">⚙</a> + <a href="/manage_feed?feed={{entry["feed_id"]}}">⚙</a> </td> </tr> % end diff --git a/views/manage_feed.tpl b/views/manage_feed.tpl new file mode 100644 index 0000000..86a9c5d --- /dev/null +++ b/views/manage_feed.tpl @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Manage Feed | TagRSS</title> + <link href="/static/styles/main.css" rel="stylesheet"> +</head> +<body> + <a href="/">< home</a> + <h1>Manage feed</h1> + <table> + <tr> + <th>Title</th> + <td>{{feed["title"]}}</td> + </tr> + <tr> + <th>Source</th> + <td>{{feed["source"]}}</td> + </tr> + <tr> + <th>Tags</th> + <td> + % tags = feed["tags"] + % for i, tag in enumerate(tags): + % if i > 0: + {{", "}} + % end + <span class="tag">{{tag}}</span> + % end + </td> + </tr> + </table> + <form method="post"> + <input type="number" name="id" value="{{feed['id']}}" style="display: none;"> + <label>Title: + <input type="text" name="title" value="{{feed['title']}}"><br> + </label> + <label>Source: + <input type="text" name="source" value="{{feed['source']}}"><br> + </label> + <div class="side-by-side-help-container"> + <label>Tags: + <input type="text" name="tags" value="{{feed['serialised_tags']}}"> + </label> + <span class="hover-help" tabindex="0" title="Space separated. Backslashes escape spaces.">🛈</span> + </div> + <input type="submit" value="Update" name="update_feed"> + </form> + <hr> + <form method="post" action="/delete"> + <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 |