Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
D Ruth Bavousett 2880e76e8f Bug 8061: RTL CSS overrides (OPAC)
This patch repairs a few things in templates and CSS to allow
for the injection of right-to-left CSS, also in this patch.
It should apply to 3.8 and master.

To test, install and enable a right-to-left language for the
OPAC, currently Hebrew or Arabic.
The Arabic OPAC translations for 3.6 are mostly-complete, so
they are a good test case.

It's helpful to have a reader of the language handy, but the
layout should be easy enough to figure out, even for
non-readers.

Signed-off-by: Karam Qubsi <karamqubsi@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Amended patch adding back author and adding sign off.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-07 12:51:54 -04:00

79 lines
3.7 KiB
Text

[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Comments on [% title |html %]
<style type="text/css">
#custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
</style>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var inject_old = function(comment) {
[% IF ( reviewid ) %]
[% 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(" <a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&amp;reviewid=[% reviewid | uri%]\');\">"+_("Edit")+"<\/a>");
[% END %]
return 1;
};
var inject_new = function(comment) {
[% IF ( cgi_debug ) %]alert(_("injecting NEW comment: ") +comment);[% END %]
parent.opener.$('#newcomment').attr("class","yours");
parent.opener.$('#newcomment').html(
"<h5>" + _("Your comment (preview, pending approval)") + "<\/h5>" +
"<p>"+comment+"<\/p>" +
"<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">"+_("Edit")+"<\/a><\/p>"
);
parent.opener.$("#addcomment").prev("p").remove();
parent.opener.$("#addcomment").remove();
};
[% IF ( clean_review ) %]
var clean_review = "[% clean_review |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"; // TMPL var must not contain " quotes.
[% IF ( reviewid ) %]
inject_old(clean_review);
[% ELSE %]
inject_new(clean_review);
[% END %]
[% END %]
[% IF ( WINDOW_CLOSE ) %]
[% IF ( ERRORS ) %]
setTimeout("window.close()",5000); // flash this page, then close. Change warning in template if you change this value.
[% ELSE %]
window.close();
[% END %]
[% END %]
});
//]]>
</script>
</head>
<body id="comment">
<div id="custom-doc" class="yui-t7">
<div id="userreview" class="container">
[% IF ( cgi_debug ) %]<div class="debug">CGI debug is on.</div>[% END %]
[% IF ( ERRORS ) %]
<div class="dialog alert">
[% FOREACH ERROR IN ERRORS %]
<p>
[% IF ( ERROR.scrubbed ) %]Note: your comment contained illegal markup code.
It has been saved with the markup removed, as below.
You can edit the comment further, or cancel to retain the comment as is.
[% END %]
[% IF ( ERROR.scrubbed_all ) %]Error! Your comment was entirely illegal markup code. It has NOT been added.[% END %]
[% IF ( ERROR.empty ) %]Error! You cannot add an empty comment. Please add content or cancel.[% END %]
</p>
[% END %]
[% IF ( WINDOW_CLOSE ) %]Note: this window will close automatically in 5 seconds[% END %]
</div>
[% END %]
<form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
<input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
[% IF ( reviewid ) %]<input type="hidden" name="reviewid" value="[% reviewid | html%]" />[% END %]
<fieldset class="brief">
<legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author |html %][% END %]</legend>
<ol><li><textarea id="review" name="review" cols="60" rows="8">[% 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 close" href="#">Cancel</a></fieldset>
</form></div>
</div>
</body>
</html>