source: bookmarks/trunk/bookmark.tt @ 81

Last change on this file since 81 was 66, checked in by peter, 10 years ago
  • the bookmark.tt template takes a hash or object named bookmark as its only variable
  • moved the calculation of a human-readable timestamp and the ISO timestamps for the WayBack machine from the BookmarkController class into the Bookmark class as methods (created, updated, created_iso, and updated_iso
  • moved the exists flag into the Bookmark class as an attribute
File size: 2.3 KB
Line 
1<html>
2  <head>
3    <title>Bookmark: [% bookmark.title or bookmark.uri %]</title>
4    <style type="text/css">
5body, th, td {
6    font-size: .875em;
7}
8h1 {
9  font-size: 1.25em;
10}
11li {
12    margin-bottom: .5em;
13}
14th {
15    text-align: right;
16    font-weight: normal;
17}
18    </style>
19  </head>
20  <body>
21    <div>
22      <h1>
23      [% UNLESS bookmark.exists %]
24        <strong>New bookmark:</strong>
25      [% END %]
26      <a href="[% bookmark.uri | html %]" target="_blank">[% bookmark.title or bookmark.uri %]</a>
27      </h1>
28      [% IF bookmark.exists %]
29        <p class="timestamps">
30          Bookmark created <a href="http://web.archive.org/web/[% bookmark.created_iso %]/[% bookmark.uri %]" title="Nearest Wayback Machine Link" target="_blank">[% bookmark.created %]</a>[% IF bookmark.mtime != bookmark.ctime %]; updated
31          <a href="http://web.archive.org/web/[% bookmark.updated_iso %]/[% bookmark.uri %]" title="Nearest Wayback Machine Link" target="_blank">[% bookmark.updated %]</a>[% END %]
32        </p>
33        [% IF bookmark.tags.size %]
34          <p class="tags">Tagged as:
35            [% FOREACH tag IN bookmark.tags %]
36              <a href=".?tag=[% tag %]" class="tag" target="_blank" onclick="if (opener && !opener.closed) { opener.location = this.href; return false; }">[% tag %]</a>
37            [% END %]
38          </p>
39        [% END %]
40      [% END %]
41      <form method="post" action="">
42        <table>
43          <tr>
44            <th>URI:</th>
45            <td>
46              <input type="text" name="uri" value="[% bookmark.uri | html %]" size="80"/>
47            </td>
48          </tr>
49          <tr>
50            <th>Title:</th>
51            <td>
52              <input type="text" name="title" value="[% bookmark.title | html %]" size="80"/>
53            </td>
54          </tr>
55          <tr>
56            <th>Tags:</th>
57            <td>
58              <input type="text" name="tags" value="[% bookmark.tags.join(' ') | html %]" size="80"/>
59            </td>
60          </tr>
61          <tr>
62            <th></th>
63            <td>
64              <input type="submit" value="Save"/>
65            </td>
66          </tr>
67        </table>
68      </form>
69    </div>
70    <script>
71window.onload = function() {
72    if (document.location.hash == '#updated') {
73        if (opener) {
74            opener.location.reload();
75        }
76    }
77};
78    </script>
79  </body>
80</html>
81
82<!--
83vim:syntax=html
84-->
Note: See TracBrowser for help on using the repository browser.