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
RevLine 
[2]1<html>
2  <head>
3    <title>Bookmarks</title>
[3]4    <base href="[% base_url %]"/>
[2]5    <style type="text/css">
6a:hover {
7    text-decoration: none;
8}
9.edit {
10    font-size: .85em;
11}
[4]12input, select {
13    font-size: .875em;
14    font-family: 'DejaVu Sans', sans-serif;
15}
[2]16body, th, td {
17    margin: 0;
[4]18    font-size: .75em;
19    font-family: 'DejaVu Sans', sans-serif;
[2]20}
21ul {
22    margin: 0;
23    padding: 0;
[20]24}
25ul.main {
26    height: 60%;
[2]27    border-top: 6px solid #eee;
28    border-bottom: 6px solid #eee;
29}
[20]30.refine {
31    height: 15%;
32}
[21]33.refine form {
34    margin: 0;
35}
36.buttons {
37    margin: .5em;
38}
[20]39.cotags {
40    height: 100%;
[21]41    border-top: 1px dotted #999;
42    border-bottom: 1px dotted #999;
[20]43}
44ul.main, ul.cotags {
45    overflow-y: scroll !important;
46}
[2]47li {
[11]48    padding: .25em 0 0 .25em;
[2]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}
[11]63.tags a {
64    color: #999;
65    text-decoration: none;
66}
67.tags a:hover {
68    text-decoration: underline;
69}
[10]70.tags {
[11]71    color: #999;
72    margin-top: .125em;
73    margin-left: 3em;
74    font-size: .875em;
[10]75}
[2]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>
[20]82        [% FOREACH tag IN all_tags %]
[2]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>
[20]88    <ul class="main">
[2]89      [%  FOREACH resource IN resources %]
90        <li>
91          <span class="edit">
[3]92            (<a href="[% resource.id %]" onclick="window.open(this.href, 'edit_bookmark', 'width=800,height=250').focus(); return false;">Edit</a>)
[2]93          </span>
94          <a href="[% resource.uri %]" title="[% resource.title | html %] ([% resource.tags.join(', ') %])">[% resource.title or resource.uri %]</a>
[11]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>
[2]100        </li>
101      [%  END %]
102    </ul>
[21]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 %]
[20]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>
[21]138        <div class="buttons">
[20]139          <input type="submit" value="Refine"/>
140        </div>
141      </form>
142    </div>
[2]143  </body>
144</html>
145
146<!--
147vim:syntax=html
148-->
Note: See TracBrowser for help on using the repository browser.