source: bookmarks/trunk/list.tt @ 21

Last change on this file since 21 was 21, checked in by peter, 11 years ago
  • added links to the JSON and XBEL formats of the current list
  • all links to the current list take into account the full list of tags in the query
  • minor style tweaks to the cotags list
File size: 3.6 KB
Line 
1<html>
2  <head>
3    <title>Bookmarks</title>
4    <base href="[% base_url %]"/>
5    <style type="text/css">
6a:hover {
7    text-decoration: none;
8}
9.edit {
10    font-size: .85em;
11}
12input, select {
13    font-size: .875em;
14    font-family: 'DejaVu Sans', sans-serif;
15}
16body, th, td {
17    margin: 0;
18    font-size: .75em;
19    font-family: 'DejaVu Sans', sans-serif;
20}
21ul {
22    margin: 0;
23    padding: 0;
24}
25ul.main {
26    height: 60%;
27    border-top: 6px solid #eee;
28    border-bottom: 6px solid #eee;
29}
30.refine {
31    height: 15%;
32}
33.refine form {
34    margin: 0;
35}
36.buttons {
37    margin: .5em;
38}
39.cotags {
40    height: 100%;
41    border-top: 1px dotted #999;
42    border-bottom: 1px dotted #999;
43}
44ul.main, ul.cotags {
45    overflow-y: scroll !important;
46}
47li {
48    padding: .25em 0 0 .25em;
49    color: #999;
50    white-space: nowrap;
51    list-style-type: none;
52}
53th {
54    text-align: right;
55    font-weight: normal;
56}
57form {
58    margin: .5em;
59}
60p {
61    margin: .5em;
62}
63.tags a {
64    color: #999;
65    text-decoration: none;
66}
67.tags a:hover {
68    text-decoration: underline;
69}
70.tags {
71    color: #999;
72    margin-top: .125em;
73    margin-left: 3em;
74    font-size: .875em;
75}
76    </style>
77  </head>
78  <body>
79    <form method="get" action="">
80      <select name="tag" onchange="document.forms[0].submit()">
81        <option value="">All bookmarks</option>
82        [% FOREACH tag IN all_tags %]
83          <option value="[% tag.tag %]" [% IF tag.selected %]selected="selected"[% END %]>[% tag.tag %] ([% tag.count %])</option>
84        [% END %]
85      </select>
86      <input type="submit" value="Go"/>
87    </form>
88    <ul class="main">
89      [%  FOREACH resource IN resources %]
90        <li>
91          <span class="edit">
92            (<a href="[% resource.id %]" onclick="window.open(this.href, 'edit_bookmark', 'width=800,height=250').focus(); return false;">Edit</a>)
93          </span>
94          <a href="[% resource.uri %]" title="[% resource.title | html %] ([% resource.tags.join(', ') %])">[% resource.title or resource.uri %]</a>
95          <div class="tags">
96            [% FOREACH tag IN resource.tags %]
97              [% IF loop.first %]([% END %]<a target="_self" href="?tag=[% tag %]">[% tag %]</a>[% IF loop.last %])[% ELSE %], [% END %]
98            [% END %]
99          </div>
100        </li>
101      [%  END %]
102    </ul>
103    [% IF search_tags.size %]
104    <!-- TODO: well-formatted query strings if there is no tag query -->
105      <p>
106        <a href="?[% tag_query %]">Link</a> &middot;
107        <a href="?[% tag_query %]&format=json" type="application/json">JSON</a> &middot;
108        <a href="?[% tag_query %]&format=xbel" type="application/xml">XBEL</a> &middot;
109        <a href="feed?[% tag_query %]" type="application/atom+xml">Atom</a>
110      </p>
111    [% END %]
112    <div class="refine">
113      <form method="get" action="">
114        <div class="taglists">
115          <ul class="searchtags">
116            [% FOREACH tag IN search_tags %]
117              <li>
118                <label>
119                  <input type="checkbox" name="tag" value="[% tag %]" checked="checked"/>
120                  [% tag %]
121                </label>
122              </li>
123            [% END %]
124          </ul>
125          [% IF cotags.size %]
126            <ul class="cotags">
127              [% FOREACH tag IN cotags %]
128                <li>
129                  <label>
130                    <input type="checkbox" name="tag" value="[% tag.tag %]"/>
131                    [% tag.tag %] ([% tag.count %])
132                  </label>
133                </li>
134              [% END %]
135            </ul>
136          [% END %]
137        </div>
138        <div class="buttons">
139          <input type="submit" value="Refine"/>
140        </div>
141      </form>
142    </div>
143  </body>
144</html>
145
146<!--
147vim:syntax=html
148-->
Note: See TracBrowser for help on using the repository browser.