Improving comments style and markup, adding highlighting for comments made by logged-in user.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Owen Leonard 2008-03-28 14:23:32 -05:00 committed by Joshua Ferraro
parent b179819d08
commit 68a7738026
5 changed files with 52 additions and 12 deletions

View 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;
}

View file

@ -312,7 +312,21 @@
<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"-->
@ -323,18 +337,21 @@
</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 -->

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View file

@ -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