Improving comments style and markup, adding highlighting for comments made by logged...
authorOwen Leonard <oleonard@myacpl.org>
Fri, 28 Mar 2008 19:23:32 +0000 (14:23 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 1 Apr 2008 11:45:48 +0000 (06:45 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tmpl
koha-tmpl/opac-tmpl/prog/images/further-bullet.gif [new file with mode: 0644]
opac/opac-detail.pl

index ac4463b..c1960db 100644 (file)
@@ -1285,6 +1285,10 @@ div#menu li.active a:hover {
        padding : 3px 3px .5em 1em;
 }
 
+#further ul li {
+       list-style-image : url("../../images/further-bullet.gif");
+}
+
 #similars {
        background-color : #FFF;
     text-align : center;
@@ -1602,4 +1606,17 @@ input.deleteshelf {
 
 input.editshelf:active,input.deleteshelf:active {
        border : 0;
+}
+
+#comments .commentline {
+       border-bottom : 2px solid #eeeeeb;
+       margin : 0 -.5em 0 -.5em;
+       padding : 0 .5em .5em .5em;
+}
+#comments .yours {
+       background-color : #effed5;
+}
+#comments #addcomment {
+       margin : 0 -1em -1em -1em;
+       padding : .3em 1em;
 }
\ No newline at end of file
index 7b63eca..b53259e 100755 (executable)
 <div id="comments">
 <!-- TMPL_IF NAME="reviews" -->
         <!--TMPL_LOOP NAME="reviews"-->
-            <h5>
+                       <!-- TMPL_IF NAME="loggedinusername" -->
+                       <!-- TMPL_IF EXPR="userid eq loggedinusername" -->
+                       <div class="commentline yours">
+                       <h5>
+                               Your Comment
+                       </h5>
+                       <small>
+                <!--TMPL_VAR NAME="datereviewed"-->
+            </small>
+        <p>
+          <!--TMPL_VAR NAME="review"--> <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->');">Edit</a>
+        </p></div>
+                       <!-- TMPL_ELSE -->
+                       <div class="commentline">
+                       <h5>
                 Comment by
                 <!--TMPL_VAR NAME="title"-->
                 <!--TMPL_VAR NAME="firstname"-->
             </small>
         <p>
           <!--TMPL_VAR NAME="review"-->
-        </p>
+        </p></div>
+                       <!-- /TMPL_IF -->
+                       <!-- /TMPL_IF -->
         <!--/TMPL_LOOP-->
     <!-- TMPL_ELSE  -->
         <p>There are no comments for this item.</p>
 <!-- /TMPL_IF -->
-
     <!-- TMPL_IF NAME="loggedinusername" -->
-       <p> <a href="javascript:Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->');">
+               <!-- TMPL_UNLESS NAME="loggedincommenter" -->
+       <div id="addcomment"> <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->'); return false;">
             Post or edit your comments on this item.
-        </a></p>
+        </a></div>
+               <!-- /TMPL_UNLESS -->
     <!-- TMPL_ELSE -->
-        <p><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.</p>
+        <div id="addcomment"><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.</div>
     <!-- /TMPL_IF -->
        </div>
 <!-- /TMPL_IF -->
index 293aa73..9598082 100644 (file)
@@ -9,14 +9,14 @@
 <h3> </h3>
 
 <form action="/cgi-bin/koha/opac-review.pl" method="post" onsubmit="return closeWindow();"> 
-    <input type="hidden" name="biblionumber" value="<!--TMPL_VAR NAME="biblionumber"-->">
-    <input type="hidden" name="type" value="<TMPL_VAR NAME="type">">
+    <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
+    <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
        <fieldset class="brief">
        <legend>Comments on <i><!--TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></i><!-- TMPL_IF NAME="author" -->by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --></legend>
-            <ol><li><textarea name="review" cols=60 rows=8><!--TMPL_VAR NAME="review"--></textarea></li></ol>
+            <ol><li><textarea name="review" cols="60" rows="8"><!--TMPL_VAR NAME="review"--></textarea></li></ol>
                </fieldset>
     <p>Note: Your comment must be approved by a librarian. </p>
-               <fieldset class="action"> <input type="submit" value="Submit and close this window" /> <a class="cancel" href="#" onclick="closeWindow(); return false;">Cancel</a></fieldset>
+               <fieldset class="action"> <input type="submit" value="Submit and close this window" /> <a class="cancel close" href="#">Cancel</a></fieldset>
 </form>
 
 <script type="text/javascript" language="javascript">
@@ -27,4 +27,6 @@
 </script>
 </div>
 
-<!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->
+</body>
+</html>
+
diff --git a/koha-tmpl/opac-tmpl/prog/images/further-bullet.gif b/koha-tmpl/opac-tmpl/prog/images/further-bullet.gif
new file mode 100644 (file)
index 0000000..f5e240f
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/images/further-bullet.gif differ
index 9b10d20..b3f6d65 100755 (executable)
@@ -162,6 +162,7 @@ $template->param(
 );
 
 my $reviews = getreviews( $biblionumber, 1 );
+my $loggedincommenter;
 foreach ( @$reviews ) {
     my $borrower_number_review = $_->{borrowernumber};
     my $borrowerData           = GetMember($borrower_number_review,'borrowernumber');
@@ -169,7 +170,9 @@ foreach ( @$reviews ) {
     $_->{title}     = $borrowerData->{'title'};
     $_->{surname}   = $borrowerData->{'surname'};
     $_->{firstname} = $borrowerData->{'firstname'};
+    $_->{userid} = $borrowerData->{'userid'};
     $_->{datereviewed} = format_date($_->{datereviewed});
+    if($borrowerData->{'borrowernumber'} eq $borrowernumber){ $loggedincommenter = 1; }
 }
 
 
@@ -183,7 +186,8 @@ $template->param(
     biblionumber        => $biblionumber,
     subscriptions       => \@subs,
     subscriptionsnumber => $subscriptionsnumber,
-    reviews             => $reviews
+    reviews             => $reviews,
+    loggedincommenter => $loggedincommenter
 );
 
 # XISBN Stuff