]> git.decadent.org.uk Git - memories.git/blobdiff - templates/macros
Merge commit 'trunk'
[memories.git] / templates / macros
index 05824ef88ce77ba83437d3613c0422b23bd796f5..5b6dc3a2b2fc0fb54649f399959c59caa9657254 100644 (file)
@@ -1,6 +1,12 @@
+[% 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%]">
 [% MACRO minithumb(photo) BLOCK %]
         <a href="[%base%]/photo/view/[%photo.id%]">
-        <img src="[% photo.thumb_url |uri%]" alt="[%photo.title|html%]"/>
+        <img src="[% photo.thumb_url %]" alt="[%photo.title|html%]"/>
         </a>
 [% END; MACRO thumb(photo, album) BLOCK %]
 <table class="thumb">
         </a>
 [% END; MACRO thumb(photo, album) BLOCK %]
 <table class="thumb">
         <small>[% FOR tag = photo.tags %] <a
         href="[%base%]/tag/view/[%tag%]">[%tag %]</a> [% END %]</small>
         </td></tr>
         <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 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 %] view[%IF photo.hit_count>1%]s[% END %]
+    [% IF r > 0 %] <br> [% ministar(r, photo) %] in [%photo.rated %]
+    rating[%IF photo.rated > 1%]s[%END%] [% 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>
         [% IF request.user %]
     [% IF album == 1 %]
         <tr><td> Add to album: <input type="checkbox" name="add[%photo.id%]" value="[%photo.id%]"> </td></tr>