X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=templates%2Fphoto%2Fview;h=0216bdaeacb01c6fa3da2392829796043034c962;hb=c4b2f2843ca943f5235a1abb001523bffb7205c4;hp=3950ce6b5a566d2d04a59d0ee988fede5c988234;hpb=7f2c0b18cfff36d5a9d0f93e9cb4102d6a931768;p=memories.git
diff --git a/templates/photo/view b/templates/photo/view
index 3950ce6..0216bda 100644
--- a/templates/photo/view
+++ b/templates/photo/view
@@ -20,62 +20,49 @@
[% END %]
-
- [% 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; %]
-
-
(Original size [%photo.dimensions %])
-
- Size:
- [% SET i = 0; WHILE i < sizes.size %]
- [% IF photo.is_bigger(sizes.$i); %]
- [% IF i == size %]
- [% sizes.$i %]
- [% ELSIF sizes.$i == "full" %]
- full
- [% ELSE %]
- [% sizes.$i %]
- [% END %]
- [% END; %]
- [% SET i = i + 1 %]
- [% END %]
-
- [%# Now put it back in the session %]
- [% SET request.session.scale = size %]
+
+
+[% 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;
+ "
";
+ tag;
+ " (";
+ tagset.$tag; ")";
+ ELSE;
+ tag;
+ IF counter > 20; "..."; LAST; END;
+ END;
+ ", " UNLESS tag == sorted.last;
+END %]
+[% PROCESS sized %]
+
[% IF photo.description OR photo.copyright OR photo.license %]
[% photo.description | html %]
@@ -84,11 +71,18 @@ photo.uploader %]
[% END %]
+
[% MACRO do_tab(tabname, label) BLOCK; %]
- [% IF tab == tabname %]
- [% ELSE %]
- [% END %]
+
[%label%]
[% END %]
@@ -100,12 +94,7 @@ photo.uploader %]
[%do_tab("similar", "Similar photos") %]
-[%
-IF request.params.active == "tagedit"; INCLUDE tagedit;
-ELSIF request.params.active == "exif"; INCLUDE exif;
-ELSIF request.params.active == "similar"; INCLUDE similar;
-ELSE; INCLUDE comment; END;
-%]
+[% INCLUDE comment %]
[%
INCLUDE footer;