From 426b02d7e53067a411a549d1a80240381d52ab62 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 8 Feb 2007 20:28:42 +0000 Subject: [PATCH] Rejig the output to cope with cases of lots of tags. git-svn-id: http://svn.simon-cozens.org/memories/trunk@13 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- templates/photo/view | 41 ++++++++++++++++++++++------------- templates/static/memories.css | 1 + 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/templates/photo/view b/templates/photo/view index 0285d75..617484c 100644 --- a/templates/photo/view +++ b/templates/photo/view @@ -20,34 +20,45 @@ [% END %] - -[% FOR tag = photo.tags; - ""; - tag; - " ("; - tag.taggings.size; ")"; - ", " UNLESS tag == photo.tags.last; -END %] - - - - + [% IF photo.albums %] In albums: [% FOR album = photo.albums; %] [%album.name%] ([%album.photos.size%]) [% ";" UNLESS album == photo.albums.last %] [% END %] +
[% END %] - - - + Photo shot on [% photo.shot.ymd %]
Uploaded by [% photo.uploader %]
+ +
+[% 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 %] +
+
[% SET sizes = request.config.sizes %] [% IF request.params.exists("scale") %] diff --git a/templates/static/memories.css b/templates/static/memories.css index 3728111..61099a7 100644 --- a/templates/static/memories.css +++ b/templates/static/memories.css @@ -91,6 +91,7 @@ p { font-family: sans-serif; } .photodesc { background: #fff; padding: 10px; margin: 5px 15px 5px 15px; text-align: center; } .photorights { font-size: 90%; padding: 10px; text-align: right; font-weight: bold; } .photolicense { font-size: 80%; padding: 10px; } +.smaller { font-size: 80% } span.tagcloud0 { font-size: 9px;} span.tagcloud1 { font-size: 10px;} -- 2.39.2