From: Simon Cozens Date: Thu, 8 Feb 2007 20:19:41 +0000 (+0000) Subject: Ajax-up the comments (References #5) and add user ratings (Closes #6). X-Git-Tag: 1.2+svn20070808~56 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=1ac69d664ef258186b9252fc610ca7d777bbdd79;p=memories.git Ajax-up the comments (References #5) and add user ratings (Closes #6). git-svn-id: http://svn.simon-cozens.org/memories/trunk@12 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- diff --git a/templates/header b/templates/header index ada7f30..50c09d7 100644 --- a/templates/header +++ b/templates/header @@ -3,6 +3,7 @@ Memories - Photo Sharing [% IF photo %] - [% photo.title; END%] + [% IF photos %] diff --git a/templates/photo/comment b/templates/photo/comment index 498e5b6..f1c74da 100644 --- a/templates/photo/comment +++ b/templates/photo/comment @@ -1,3 +1,42 @@ +

Rate this photo! + +

+ + ([%photo.approx_rating%] out of [%photo.rated%] votes) +

+
[% FOR comment = photo.comments %]
@@ -6,10 +45,9 @@
[% END %]
-
- Name:
- + + Name:
+

diff --git a/templates/static/alt_star.gif b/templates/static/alt_star.gif new file mode 100644 index 0000000..068fa7f Binary files /dev/null and b/templates/static/alt_star.gif differ diff --git a/templates/static/star.gif b/templates/static/star.gif new file mode 100644 index 0000000..32633e3 Binary files /dev/null and b/templates/static/star.gif differ diff --git a/templates/static/star_rating.css b/templates/static/star_rating.css new file mode 100644 index 0000000..8ba0141 --- /dev/null +++ b/templates/static/star_rating.css @@ -0,0 +1,84 @@ +.star-rating, +.star-rating a:hover, +.star-rating a:active, +.star-rating a:focus, +.star-rating .current-rating{ + background: url(star.gif) left -1000px repeat-x; +} +.star-rating{ + position:relative; + width:125px; + height:25px; + overflow:hidden; + list-style:none; + margin:0; + padding:0; + background-position: left top; +} +.star-rating li{ + display: inline; +} +.star-rating a, +.star-rating .current-rating{ + position:absolute; + top:0; + left:0; + text-indent:-1000em; + height:25px; + line-height:25px; + outline:none; + overflow:hidden; + border: none; +} +.star-rating a:hover, +.star-rating a:active, +.star-rating a:focus{ + background-position: left bottom; +} +.star-rating a.one-star{ + width:20%; + z-index:6; +} +.star-rating a.two-stars{ + width:40%; + z-index:5; +} +.star-rating a.three-stars{ + width:60%; + z-index:4; +} +.star-rating a.four-stars{ + width:80%; + z-index:3; +} +.star-rating a.five-stars{ + width:100%; + z-index:2; +} +.star-rating .current-rating{ + z-index:1; + background-position: left center; +} + +/* for an inline rater */ +.inline-rating{ + display:-moz-inline-block; + display:-moz-inline-box; + display:inline-block; + vertical-align: middle; +} + +/* smaller star */ +.small-star{ + width:50px; + height:10px; +} +.small-star, +.small-star a:hover, +.small-star a:active, +.small-star a:focus, +.small-star .current-rating{ + background-image: url(star_small.gif); + line-height: 10px; + height: 10px; +} diff --git a/templates/static/star_small.gif b/templates/static/star_small.gif new file mode 100644 index 0000000..f180d89 Binary files /dev/null and b/templates/static/star_small.gif differ