2 [% SET tab = request.params.active || "comment" %]
3 [% SET url = base _ "/photo/view/" _ photo.id; %]
7 <h1>[% photo.title %]</h1>
8 [% IF request.user == photo.uploader %]
9 <p><a href="[%base%]/photo/delete/[%photo.id%]">Delete this
11 <form action="[%base%]/photo/do_edit/[%photo.id%]">
12 <input name="title" value="[%photo.title |html%]">
13 <input type="submit" name="Rename" value="Rename">
17 <td align="right" class="tagbrowse">
18 [% FOR tag = photo.tags;
19 "<a href=\""; base;"/tag/view/";tag.name | html | uri;"\">";
22 tag.taggings.size; ")";
23 ", " UNLESS tag == photo.tags.last;
31 [% FOR album = photo.albums; %]
32 <a href="[%base%]/album/view/[%album.id%]">[%album.name%]</a> ([%album.photos.size%])
33 [% ";" UNLESS album == photo.albums.last %]
38 <td align="right" class="tagbrowse"><small>
39 <i>Photo shot on [% photo.shot.ymd %] </i> <br>
40 Uploaded by <a href="[%base%]/user/view/[%photo.uploader.id%]"> [%
41 photo.uploader %] </a>
45 <div class="photoview">
46 [% SET sizes = request.config.sizes %]
47 [% IF request.params.exists("scale") %]
48 [% SET size = request.params.scale %]
49 [% ELSIF request.session.scale %]
50 [% SET size = request.session.scale %]
51 [% ELSE; SET size = 1; END; %]
52 <img src="[% photo.sized_url(size) %]">
53 <p> (Original size [%photo.dimensions %]) </p>
56 [% SET i = 0; WHILE i < sizes.size %]
57 [% IF photo.is_bigger(sizes.$i); %]
61 <a href="[%url%]?scale=[% i %]&active=[%tab%]">[% sizes.$i %]</a>
67 [%# Now put it back in the session %]
68 [% SET request.session.scale = size %]
71 [% MACRO do_tab(tabname, label) BLOCK; %]
73 [% IF tab == tabname %]<a class="active">
74 [% ELSE %]<a href="[%url%]?scale=[%size%]&active=[%tabname%]">
81 [%do_tab("comment", "Comments") %]
82 [%do_tab("exif", "Photo info") %]
83 [%do_tab("tagedit", "Edit tags") %]
87 IF request.params.active == "tagedit"; INCLUDE tagedit;
88 ELSIF request.params.active == "exif"; INCLUDE exif;
89 ELSE; INCLUDE comment; END;