source: bookmarks/trunk/list.tt @ 20

Last change on this file since 20 was 20, checked in by peter, 11 years ago
  • Bookmarks::get_resources() and Bookmarks::get_cotags() both accept arrayrefs as their tag parameters
  • can now use multiple ?tag query parameters in the request and it will search for the intersection of those tags
  • bkmk list takes 0 or more --tag command line options
  • display a checkbox-based form listing the search tags and available cotags at the below the list of bookmarks
File size: 3.4 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.cotags {
34    height: 100%;
35    border: 1px dotted #999;
36}
37ul.main, ul.cotags {
38    overflow-y: scroll !important;
39}
40li {
41    padding: .25em 0 0 .25em;
42    color: #999;
43    white-space: nowrap;
44    list-style-type: none;
45}
46th {
47    text-align: right;
48    font-weight: normal;
49}
50form {
51    margin: .5em;
52}
53p {
54    margin: .5em;
55}
56.tags a {
57    color: #999;
58    text-decoration: none;
59}
60.tags a:hover {
61    text-decoration: underline;
62}
63.tags {
64    color: #999;
65    margin-top: .125em;
66    margin-left: 3em;
67    font-size: .875em;
68}
69    </style>
70  </head>
71  <body>
72    <form method="get" action="">
73      <select name="tag" onchange="document.forms[0].submit()">
74        <option value="">All bookmarks</option>
75        [% FOREACH tag IN all_tags %]
76          <option value="[% tag.tag %]" [% IF tag.selected %]selected="selected"[% END %]>[% tag.tag %] ([% tag.count %])</option>
77        [% END %]
78      </select>
79      <input type="submit" value="Go"/>
80    </form>
81    <ul class="main">
82      [%  FOREACH resource IN resources %]
83        <li>
84          <span class="edit">
85            (<a href="[% resource.id %]" onclick="window.open(this.href, 'edit_bookmark', 'width=800,height=250').focus(); return false;">Edit</a>)
86          </span>
87          <a href="[% resource.uri %]" title="[% resource.title | html %] ([% resource.tags.join(', ') %])">[% resource.title or resource.uri %]</a>
88          <div class="tags">
89            [% FOREACH tag IN resource.tags %]
90              [% IF loop.first %]([% END %]<a target="_self" href="?tag=[% tag %]">[% tag %]</a>[% IF loop.last %])[% ELSE %], [% END %]
91            [% END %]
92          </div>
93        </li>
94      [%  END %]
95    </ul>
96    <form method="get" action="" id="reload">
97      <div>
98        [% IF selected_tag %]
99          <a href="?tag=[% selected_tag %]">[% selected_tag %] links</a> &middot;
100          <a href="feed?tag=[% selected_tag %]" type="application/atom+xml">Atom Feed</a>
101          <input type="hidden" name="tag" value="[% selected_tag %]"/>
102        [% END %]
103        <input type="submit" value="Reload"/>
104      </div>
105    </form>
106    <div class="refine">
107      <form method="get" action="">
108        <div class="taglists">
109          <ul class="searchtags">
110            [% FOREACH tag IN search_tags %]
111              <li>
112                <label>
113                  <input type="checkbox" name="tag" value="[% tag %]" checked="checked"/>
114                  [% tag %]
115                </label>
116              </li>
117            [% END %]
118          </ul>
119          [% IF cotags.size %]
120            <ul class="cotags">
121              [% FOREACH tag IN cotags %]
122                <li>
123                  <label>
124                    <input type="checkbox" name="tag" value="[% tag.tag %]"/>
125                    [% tag.tag %] ([% tag.count %])
126                  </label>
127                </li>
128              [% END %]
129            </ul>
130          [% END %]
131        </div>
132        <div>
133          <input type="submit" value="Refine"/>
134        </div>
135      </form>
136    </div>
137  </body>
138</html>
139
140<!--
141vim:syntax=html
142-->
Note: See TracBrowser for help on using the repository browser.