Changeset 66 in bookmarks for trunk/bookmark.tt


Ignore:
Timestamp:
02/04/14 15:21:17 (11 years ago)
Author:
peter
Message:
  • 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:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bookmark.tt

    r64 r66  
    11<html> 
    22  <head> 
    3     <title>Bookmark: [% title or uri %]</title> 
     3    <title>Bookmark: [% bookmark.title or bookmark.uri %]</title> 
    44    <style type="text/css"> 
    55body, th, td { 
     
    2121    <div> 
    2222      <h1> 
    23       [% UNLESS exists %] 
     23      [% UNLESS bookmark.exists %] 
    2424        <strong>New bookmark:</strong> 
    2525      [% END %] 
    26       <a href="[% uri | html %]" target="_blank">[% title or uri %]</a> 
     26      <a href="[% bookmark.uri | html %]" target="_blank">[% bookmark.title or bookmark.uri %]</a> 
    2727      </h1> 
    28       [% IF exists %] 
     28      [% IF bookmark.exists %] 
    2929        <p class="timestamps"> 
    30           Bookmark created <a href="http://web.archive.org/web/[% created_iso %]/[% uri %]" title="Nearest Wayback Machine Link" target="_blank">[% created %]</a>[% IF mtime != ctime %]; updated 
    31           <a href="http://web.archive.org/web/[% updated_iso %]/[% uri %]" title="Nearest Wayback Machine Link" target="_blank">[% updated %]</a>[% END %] 
     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 %] 
    3232        </p> 
    33         [% IF tags.size %] 
     33        [% IF bookmark.tags.size %] 
    3434          <p class="tags">Tagged as: 
    35             [% FOREACH tag IN tags %] 
     35            [% FOREACH tag IN bookmark.tags %] 
    3636              <a href=".?tag=[% tag %]" class="tag" target="_blank" onclick="if (opener && !opener.closed) { opener.location = this.href; return false; }">[% tag %]</a> 
    3737            [% END %] 
     
    4444            <th>URI:</th> 
    4545            <td> 
    46               <input type="text" name="uri" value="[% uri | html %]" size="80"/> 
     46              <input type="text" name="uri" value="[% bookmark.uri | html %]" size="80"/> 
    4747            </td> 
    4848          </tr> 
     
    5050            <th>Title:</th> 
    5151            <td> 
    52               <input type="text" name="title" value="[% title | html %]" size="80"/> 
     52              <input type="text" name="title" value="[% bookmark.title | html %]" size="80"/> 
    5353            </td> 
    5454          </tr> 
     
    5656            <th>Tags:</th> 
    5757            <td> 
    58               <input type="text" name="tags" value="[% tags.join(' ') | html %]" size="80"/> 
     58              <input type="text" name="tags" value="[% bookmark.tags.join(' ') | html %]" size="80"/> 
    5959            </td> 
    6060          </tr> 
Note: See TracChangeset for help on using the changeset viewer.