<table width="100%">
<tr valign="top">
<td width="70%">
+ [% IF prev %]
+ <small><a href="[%base%]/photo/view/[%prev.id%]"><< [% prev %]</a></small>
+ [% END %]
<h1>[% photo.title %]</h1>
+ [% IF next %]
+ <small><a href="[%base%]/photo/view/[%next.id%]"> [% next %] >></a></small>
+ [% END %]
[% IF request.user == photo.uploader %]
<p><a href="[%base%]/photo/delete/[%photo.id%]">Delete this
photo</a></p>
</form>
[% END %]
</td>
-<td align="right" class="tagbrowse">
-[% FOR tag = photo.tags;
- "<a href=\""; base;"/tag/view/";tag.name | html | uri;"\">";
- tag;
- "</a> (";
- tag.taggings.size; ")";
- ", " UNLESS tag == photo.tags.last;
-END %]
-</td>
-</tr>
-<tr>
-<td>
+<td align="right">
[% IF photo.albums %]
In albums:
[% FOR album = photo.albums; %]
<a href="[%base%]/album/view/[%album.id%]">[%album.name%]</a> ([%album.photos.size%])
[% ";" UNLESS album == photo.albums.last %]
[% END %]
+<br>
[% END %]
-
-</td>
-<td align="right" class="tagbrowse"><small>
+<small>
<i>Photo shot on [% photo.shot.ymd %] </i> <br>
Uploaded by <a href="[%base%]/user/view/[%photo.uploader.id%]"> [%
photo.uploader %] </a>
-</small></td>
+</small> <br>
+[% photo.hit_count %] view[%IF photo.hit_count > 1%]s[%END%]
+</td>
</tr>
</table>
-<div class="photoview">
- [% SET sizes = request.config.sizes %]
- [% IF request.params.exists("scale") %]
- [% SET size = request.params.scale %]
- [% ELSIF request.session.scale %]
- [% SET size = request.session.scale %]
- [% ELSE; SET size = 1; END; %]
- <img src="[% photo.sized_url(size) %]">
- <p> (Original size [%photo.dimensions %]) </p>
- <p>
- Size:
- [% SET i = 0; WHILE i < sizes.size %]
- [% IF photo.is_bigger(sizes.$i); %]
- [% IF i == size %]
- [% sizes.$i %]
- [% ELSE %]
- <a href="[%url%]?scale=[% i %]&active=[%tab%]">[% sizes.$i %]</a>
- [% END %]
- [% END; %]
- [% SET i = i + 1 %]
- [% END %]
- </p>
- [%# Now put it back in the session %]
- [% SET request.session.scale = size %]
+
+<div class="tagbrowse smaller">
+[% SET tagset = {}; FOR tag = photo.tags;
+ SET name = tag.name; tagset.$name = tag.taggings.size;
+ END;
+ SET sorted = tagset.nsort.reverse;
+%]
+[% SET counter = 0;
+ FOR tag = sorted;
+ counter = counter + 1;
+ IF tagset.$tag > 1;
+ "<a href=\""; base;"/tag/view/";tag | html | uri;"\">";
+ tag;
+ "</a> (";
+ tagset.$tag; ")";
+ ELSE;
+ tag;
+ IF counter > 20; "..."; LAST; END;
+ END;
+ ", " UNLESS tag == sorted.last;
+END %]
</div>
+[% PROCESS sized %]
+
+[% IF photo.description OR photo.copyright OR photo.license %]
+<div class="photodesc">
+ [% photo.description | html %]
+ [% IF photo.copyright %] <div class="photorights"> [% photo.copyright | html %] </div> [% END %]
+ [% IF photo.license %] <div class="photolicense"> [% photo.license | html %] </div> [% END %]
+</div>
+[% END %]
+
+<script>
+function select_tab(name) {
+ document.getElementsByClassName("active").each(function (x) { x.removeClassName("active")});
+ new Ajax.Updater("content","[%base%]/photo/"+name+"/[%photo.id%]",
+ { method: "get", evalScripts: true }
+ )
+ $(name).addClassName("active");
+}
+</script>
[% MACRO do_tab(tabname, label) BLOCK; %]
<li>
- [% IF tab == tabname %]<a class="active">
- [% ELSE %]<a href="[%url%]?scale=[%size%]&active=[%tabname%]">
- [% END %]
+ <a [% IF tab == tabname %] class="active" [% END %] id="[%tabname%]" href="javascript:select_tab('[%tabname%]')">
[%label%]</a>
</li>
[% END %]
[%do_tab("comment", "Comments") %]
[%do_tab("exif", "Photo info") %]
[%do_tab("tagedit", "Edit tags") %]
+ [%do_tab("similar", "Similar photos") %]
</ul>
<div id="content">
-[%
-IF request.params.active == "tagedit"; INCLUDE tagedit;
-ELSIF request.params.active == "exif"; INCLUDE exif;
-ELSE; INCLUDE comment; END;
-%]
+[% INCLUDE comment %]
</div>
[%
INCLUDE footer;