Changeset 64 in bookmarks


Ignore:
Timestamp:
09/10/13 16:54:01 (11 years ago)
Author:
peter
Message:
  • provide wayback machine links to the bookmarked URI at the ctime and mtime
  • assemble the created/updated line in the template instead of the controller
  • made the bookmark title into an h1 heading on the view/edit page
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BookmarkController.pm

    r63 r64  
    337337        } else { 
    338338            # display the bookmark form for this bookmark 
     339            # TODO: these should probably be methods on the Bookmark class 
    339340            $bookmark->{exists} = 1; 
    340             $bookmark->{created} = "Created " . localtime($bookmark->ctime); 
    341             $bookmark->{created} .= '; Updated ' . localtime($bookmark->mtime) unless $bookmark->ctime == $bookmark->mtime; 
     341            $bookmark->{created} = localtime($bookmark->ctime); 
     342            $bookmark->{updated} = localtime($bookmark->mtime); 
     343            ($bookmark->{created_iso} = time2isoz($bookmark->ctime)) =~ s/\D//g; 
     344            ($bookmark->{updated_iso} = time2isoz($bookmark->mtime)) =~ s/\D//g; 
    342345            my $template = Template->new; 
    343346            $template->process( 
  • trunk/bookmark.tt

    r45 r64  
    55body, th, td { 
    66    font-size: .875em; 
     7} 
     8h1 { 
     9  font-size: 1.25em; 
    710} 
    811li { 
     
    1720  <body> 
    1821    <div> 
     22      <h1> 
    1923      [% UNLESS exists %] 
    2024        <strong>New bookmark:</strong> 
    2125      [% END %] 
    2226      <a href="[% uri | html %]" target="_blank">[% title or uri %]</a> 
     27      </h1> 
    2328      [% IF exists %] 
    24         <p class="timestamps">[% created %]</p> 
     29        <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 %] 
     32        </p> 
    2533        [% IF tags.size %] 
    2634          <p class="tags">Tagged as: 
Note: See TracChangeset for help on using the changeset viewer.