From ce038936d1b45ba8799e9ce740d573048b36a2fa Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 16 Aug 2012 15:19:04 -0400 Subject: [PATCH] Bug 8617 - Problem with display of comments waiting for moderation in OPAC This patch addresses on aspect of Bug 8617: The behavior where live previews of edited comments are displaying on opac-detail as a duplicate comment. We must pass the review id back to the script when submitting so that the check for it will evaluate as true when it should. This patch also corrects some JavaScript for translatability. To test, submit a comment on a title and approve it. Return to the title and edit the comment. When you submit your revised comment the comment pop-up window should close and your revised comment should appear on opac-detail as "pending approval." Signed-off-by: Julian Maurice Signed-off-by: Paul Poulain --- koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt index 6e2b974447..6845f6bbbf 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt @@ -11,7 +11,7 @@ [% IF ( cgi_debug ) %]alert(_('injecting OLD comment: ')+comment);[% END %] parent.opener.$('#c[% reviewid %] p').prev("small").prev("h5").html(_("Your edited comment (preview, pending approval)")); parent.opener.$('#c[% reviewid %] p').html(comment); - parent.opener.$('#c[% reviewid %] p').append("Edit<\/a>"); + parent.opener.$('#c[% reviewid %] p').append(" "+_("Edit")+"<\/a>"); [% END %] return 1; }; @@ -21,7 +21,7 @@ parent.opener.$('#newcomment').html( "
" + _("Your comment (preview, pending approval)") + "<\/h5>" + "

"+comment+"<\/p>" + - "Edit<\/a><\/p>" + ""+_("Edit")+"<\/a><\/p>" ); parent.opener.$("#addcomment").prev("p").remove(); parent.opener.$("#addcomment").remove(); @@ -41,7 +41,6 @@ window.close(); [% END %] [% END %] - // $('#reviewf').submit(function() {}); }); //]]> @@ -67,6 +66,7 @@ [% END %]

+ [% IF ( reviewid ) %][% END %]
Comments on [% title |html %] [% subtitle %][% IF ( author ) %]by [% author %][% END %]
-- 2.39.2