Bug 2780 - Capitalize strings consistently (OPAC pages)
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-review.tt
1 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog › Comments on [% title %]
2 [% INCLUDE 'doc-head-close.inc' %]
3 <style type="text/css">
4   #custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
5 </style>
6 <script type="text/JavaScript" language="JavaScript">
7 //<![CDATA[
8          $(document).ready(function() {
9                 var inject_old = function(comment) {
10                         [% IF ( reviewid ) %]
11                         [% IF ( cgi_debug ) %]alert(_('injecting OLD comment: ')+comment);[% END %]
12             parent.opener.$('#c[% reviewid %] p').prev("small").prev("h5").html("Your edited comment (preview, pending approval)");
13                         parent.opener.$('#c[% reviewid %] p').html(comment);
14                         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>");
15                         [% END %]
16                         return 1;
17                 };
18                 var inject_new = function(comment) {
19                         [% IF ( cgi_debug ) %]alert(_("injecting NEW comment: ") +comment);[% END %]
20                         parent.opener.$('#newcomment').attr("class","yours");
21                         parent.opener.$('#newcomment').html(
22                 "<h5>Your comment (preview, pending approval)<\/h5>" +
23                                 "<p>"+comment+"<\/p>" +
24                                 "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">Edit<\/a><\/p>"
25                         );
26                         parent.opener.$("#addcomment").prev("p").remove();
27                         parent.opener.$("#addcomment").remove();
28                 };
29                 [% IF ( clean_review ) %]
30                         var clean_review = "[% clean_review |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";            // TMPL var must not contain " quotes.
31                         [% IF ( reviewid ) %]
32                         inject_old(clean_review);
33                         [% ELSE %]
34                         inject_new(clean_review);
35                         [% END %]
36                 [% END %]
37                 [% IF ( WINDOW_CLOSE ) %]
38                         [% IF ( ERRORS ) %]
39                                 setTimeout("window.close()",5000);      // flash this page, then close.  Change warning in template if you change this value.
40                         [% ELSE %]
41                                 window.close();
42                         [% END %]
43                 [% END %]
44                 // $('#reviewf').submit(function() {});
45         });
46 //]]>
47 </script>
48 </head>
49 <body id="comment">
50 <div id="custom-doc" class="yui-t7">
51 <div id="userreview" class="container">
52 [% IF ( cgi_debug ) %]<div class="debug">CGI debug is on.</div>[% END %]
53 [% IF ( ERRORS ) %]
54         <div class="error">
55         [% FOREACH ERROR IN ERRORS %]
56                 <p>
57                 [% IF ( ERROR.scrubbed ) %]Note: your comment contained illegal markup code.
58                         It has been saved with the markup removed, as below.
59                         You can edit the comment further, or cancel to retain the comment as is.
60                 [% END %]
61                 [% IF ( ERROR.scrubbed_all ) %]Error!  Your comment was entirely illegal markup code.  It has NOT been added.[% END %]
62                 [% IF ( ERROR.empty ) %]Error!  You cannot add an empty comment.  Please add content or cancel.[% END %]
63                 </p>
64         [% END %]
65         [% IF ( WINDOW_CLOSE ) %]Note: this window will close automatically in 5 seconds[% END %]
66         </div>
67 [% END %]
68 <form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
69     <input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
70         <fieldset class="brief">
71         <legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author %][% END %]</legend>
72             <ol><li><textarea id="review" name="review" cols="60" rows="8">[% review %]</textarea></li></ol>
73                 </fieldset>
74     <p>Note: Your comment must be approved by a librarian. </p>
75                 <fieldset class="action"> <input type="submit" value="Submit and close this window" /> <a class="cancel close" href="#">Cancel</a></fieldset>
76 </form></div>
77 </div>
78 </body>
79 </html>