]> git.decadent.org.uk Git - memories.git/blobdiff - templates/photo/comment
Take username from logged in user. Fixes #20.
[memories.git] / templates / photo / comment
index f1c74da61903305031519af0ef3848307e744d54..6b867220d708c5e86bda2e4d41d99ad0f3b5c889 100644 (file)
@@ -11,7 +11,9 @@
    <li><a href='javascript:add_rating(5)' title='5 stars out of 5' class='five-stars'>5</a></li>
    </ul>
 </span>
+ [% IF photo.rated > 0%]
  ([%photo.approx_rating%] out of [%photo.rated%] votes) 
+ [% END %]
 </p>
 <script>
 add_rating = function (rank) {
@@ -46,7 +48,12 @@ function post_comment () {
 [% END %]
     <div class="comment">
         <form action="javascript:post_comment()" method="post">
-        Name: <input id="commentname" name="name" /> <hr>
+        [% IF request.user %]
+        <input id="commentname" name="name" type="hidden" value="[% request.user |html %]"/> 
+        [% ELSE %]
+        Name: <input id="commentname" name="name" /> 
+        <hr>
+        [% END %]
         <textarea id="newcomment" name="content" cols="60" rows="5"/></textarea>
         <p>
         <input type="submit" name="Comment on this picture" value="Comment on this picture">