Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-shareshelf.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Share a list</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% BLOCK cssinclude %][% END %]
6 </head>
7
8 [% INCLUDE 'bodytag.inc' bodyid='opac-shareshelf' bodyclass='scrollto' %]
9 [% INCLUDE 'masthead.inc' %]
10 <div class="main">
11     <ul class="breadcrumb">
12         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
13         [% IF ( loggedinusername ) %]
14             <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
15         [% END %]
16         <li><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <span class="divider">&rsaquo;</span></li>
17         <li>Share a list</li>
18     </ul> <!-- / .breadcrumb -->
19
20     <div class="container-fluid">
21         <div class="row-fluid">
22             [% IF ( OpacNav ) %]
23                 <div class="span2">
24                     <div id="navigation">
25                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
26                     </div>
27                 </div>
28             [% END %]
29
30             <div class="span10">
31                 <div id="shareshelf" class="maincontent">
32
33 [%# This section contains the essential code for error messages and three operations: invite, confirm_invite and accept. %]
34     <h2>Share a list with another patron</h2>
35
36     [% IF errcode %]
37         [% IF errcode==1 && op %]<div class="alert">The operation [% op | html %] is not supported.</div>[% END %]
38         [% IF errcode==1 && !op %]<div class="alert">No operation parameter has been passed.</div>[% END %]
39         [% IF errcode==2 %]<div class="alert">Invalid shelf number.</div>[% END %]
40         [% IF errcode==3 %]<div class="alert">The feature of sharing lists is not in use in this library.</div>[% END %]
41         [% IF errcode==4 %]<div class="alert">You can only share a list if you are the owner.</div>[% END %]
42         [% IF errcode==5 %]<div class="alert">You cannot share a public list.</div>[% END %]
43         [% IF errcode==6 %]<div class="alert">Sorry, but you did not enter a valid email address.</div>[% END %]
44         [% IF errcode==7 %]<div class="alert">Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.</div>[% END %]
45         [% IF errcode==8 %]<div class="alert">As owner of a list you cannot accept an invitation for sharing it.</div>[% END %]
46         <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1">Return to your lists</a></p>
47
48     [% ELSIF op=='invite' %]
49         <div id="invite">
50         <form id="share_list">
51         <fieldset class="rows">
52             <ol>
53             <input type="hidden" name="op" value="conf_invite"/>
54             <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]"/>
55             <li><label for="name">List name:</label> [% shelfname | html %]</li>
56             <li>
57                 <label for="invite_address">Email address:</label>
58                 <input id="invite_address" name="invite_address" size="40" />
59             </li>
60             </ol>
61         </fieldset>
62         <fieldset class="action">
63             <input type="submit" value="Send" class="btn" />
64             <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" class="cancel">Cancel</a>
65         </fieldset>
66         </form>
67         </div>
68
69     [% ELSIF op=='conf_invite' %]
70         <div id="conf_invite">
71         [% IF approvedaddress %]
72         <p>An invitation to share list <i>[% shelfname | html %]</i> will be sent shortly to [% approvedaddress | html %].</p>
73         [% END %]
74         [% IF failaddress %]
75             <p>Something went wrong while processing the following addresses. Please check them. These are: [% failaddress | html %]</p>
76         [% END %]
77         [% IF approvedaddress %]
78         <p>You will receive an email notification if someone accepts your share within two weeks.</p>
79         [% END %]
80         <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1">Return to your lists</a></p>
81         </div>
82
83     [% ELSIF op=='accept' %]
84         [%# Nothing to do: we already display an error or we redirect. %]
85     [% END %]
86
87         </div> <!-- / .span10 -->
88     </div> <!-- / .maincontent -->
89 [%# End of essential part %]
90
91         </div> <!-- / .row-fluid -->
92     </div> <!-- / .container-fluid -->
93 </div> <!-- / .main -->
94 [% INCLUDE 'opac-bottom.inc' %]
95 [% BLOCK jsinclude %]
96 <script>
97 //<![CDATA[
98     $(document).ready(function(){
99         $("#share_list").on('submit', function(e) {
100             var address = $("#invite_address").val();
101             if ( address.length == 0) {
102                 e.preventDefault();
103             }
104         });
105     });
106 //]]>
107 </script>
108 [% END %]