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