2 [% SET tab = request.params.active || "comment" %]
3 [% SET url = base _ "/photo/view/" _ photo.id; %]
8 <small><a href="[%base%]/photo/view/[%prev.id%]"><< [% prev %]</a></small>
10 <h1>[% photo.title %]</h1>
12 <small><a href="[%base%]/photo/view/[%next.id%]"> [% next %] >></a></small>
14 [% IF request.user == photo.uploader %]
15 <p><a href="[%base%]/photo/delete/[%photo.id%]">Delete this
17 <form action="[%base%]/photo/do_edit/[%photo.id%]">
18 <input name="title" value="[%photo.title |html%]">
19 <input type="submit" name="Rename" value="Rename">
23 <td align="right" class="tagbrowse">
24 [% FOR tag = photo.tags;
25 "<a href=\""; base;"/tag/view/";tag.name | html | uri;"\">";
28 tag.taggings.size; ")";
29 ", " UNLESS tag == photo.tags.last;
37 [% FOR album = photo.albums; %]
38 <a href="[%base%]/album/view/[%album.id%]">[%album.name%]</a> ([%album.photos.size%])
39 [% ";" UNLESS album == photo.albums.last %]
44 <td align="right" class="tagbrowse"><small>
45 <i>Photo shot on [% photo.shot.ymd %] </i> <br>
46 Uploaded by <a href="[%base%]/user/view/[%photo.uploader.id%]"> [%
47 photo.uploader %] </a>
51 <div class="photoview">
52 [% SET sizes = request.config.sizes %]
53 [% IF request.params.exists("scale") %]
54 [% SET size = request.params.scale %]
55 [% ELSIF request.session.scale %]
56 [% SET size = request.session.scale %]
57 [% ELSE; SET size = 1; END; %]
58 <img src="[% photo.sized_url(size) %]">
59 <p> (Original size [%photo.dimensions %]) </p>
62 [% SET i = 0; WHILE i < sizes.size %]
63 [% IF photo.is_bigger(sizes.$i); %]
66 [% ELSIF sizes.$i == "full" %]
67 <a href="[%photo.path("url")%]">full</a>
69 <a href="[%url%]?scale=[% i %]&active=[%tab%]">[% sizes.$i %]</a>
75 [%# Now put it back in the session %]
76 [% SET request.session.scale = size %]
79 [% IF photo.description OR photo.copyright OR photo.license %]
80 <div class="photodesc">
81 [% photo.description | html %]
82 [% IF photo.copyright %] <div class="photorights"> [% photo.copyright | html %] </div> [% END %]
83 [% IF photo.license %] <div class="photolicense"> [% photo.license | html %] </div> [% END %]
87 [% MACRO do_tab(tabname, label) BLOCK; %]
89 [% IF tab == tabname %]<a class="active">
90 [% ELSE %]<a href="[%url%]?scale=[%size%]&active=[%tabname%]">
97 [%do_tab("comment", "Comments") %]
98 [%do_tab("exif", "Photo info") %]
99 [%do_tab("tagedit", "Edit tags") %]
100 [%do_tab("similar", "Similar photos") %]
104 IF request.params.active == "tagedit"; INCLUDE tagedit;
105 ELSIF request.params.active == "exif"; INCLUDE exif;
106 ELSIF request.params.active == "similar"; INCLUDE similar;
107 ELSE; INCLUDE comment; END;