aboutsummaryrefslogtreecommitdiff
path: root/views/index.tpl
blob: dc79b0b57897fa850e85b14b09c9ead134874b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
% 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 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" class="no-visited-indication">Add feed</a>&nbsp;|
            <a href="/list_feeds" class="no-visited-indication">List feeds</a>
        </p>
    </nav>
    <table>
        <thead>
            <tr>
                <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 + offset}}</td>
                    <td><a href="{{entry['link']}}">{{entry["title"]}}</a></td>
                    <%
                        date = ""
                        if entry.get("epoch_published", None):
                            date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(entry["epoch_published"]))
                        end
                        if entry.get("epoch_updated", None):
                            date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(entry["epoch_updated"]))
                        end
                    %>
                    <td>
                        <time datetime="{{date}}">{{date}}</time>
                    </td>
                    <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
                        </div>
                    </td>
                    <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
        </tbody>
    </table>
    <form>
        <label>Page
            <input type="number" value="{{page_num}}" min="1" max="{{total_pages}}" name="page_num">
        </label> of {{total_pages}}.
        <label>Per page:
            <input type="number" value="{{per_page}}" min="1" max="{{max_per_page}}" name="per_page">
        </label>
        <input type="submit" value="Go">
    </form>
</body>
</html>