]> git.decadent.org.uk Git - memories.git/commitdiff
My God, it's full of stars.
authorSimon Cozens <simon@simon-cozens.org>
Thu, 8 Feb 2007 21:00:51 +0000 (21:00 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 8 Feb 2007 21:00:51 +0000 (21:00 +0000)
git-svn-id: http://svn.simon-cozens.org/memories/trunk@18 041978f6-d955-411f-a9d7-1d8545c9c3c7

templates/macros

index 05824ef88ce77ba83437d3613c0422b23bd796f5..514f270cb5c4047ce0f1d7df31b4762d273413d7 100644 (file)
@@ -1,3 +1,9 @@
+[% MACRO ministar(rating, photo) BLOCK;
+IF photo.rated > 0; %]
+<span class="inline-rating"><ul class="star-rating small-star">
+<li class="current-rating" style="width:[%rating * 20 %]%">Currently [%rating%]/5 Stars.</li>
+</ul></span>
+[% END; END %]
 [% MACRO minithumb(photo) BLOCK %]
         <a href="[%base%]/photo/view/[%photo.id%]">
         <img src="[% photo.thumb_url |uri%]" alt="[%photo.title|html%]"/>
         <small>[% FOR tag = photo.tags %] <a
         href="[%base%]/tag/view/[%tag%]">[%tag %]</a> [% END %]</small>
         </td></tr>
-    <tr><td> Uploaded by 
+    <tr><td style="background:#fff"> Uploaded by 
         <a href="[%base%]/user/view/[%photo.uploader.id%]">
             [% photo.uploader.name |html%]
-        </a><br/> at [% photo.uploaded %] </td></tr>
+        </a><br/> at [% photo.uploaded %] 
+        [% SET r = photo.approx_rating %]
+        <br/>
+[% IF r > 0 OR photo.hit_count > 0 %]
+    [% photo.hit_count %] views
+    [% IF r > 0 %] <br> [% ministar(r, photo) %] in [%photo.rated %] ratings [% END %]
+[% END %]
+    </td></tr>
         [% IF request.user %]
     [% IF album == 1 %]
         <tr><td> Add to album: <input type="checkbox" name="add[%photo.id%]" value="[%photo.id%]"> </td></tr>