Bug 28959: (follow-up) Adjust more places in which 'category' was used
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-shareshelf.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Share a list &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</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     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
12         <ol class="breadcrumb">
13             <li class="breadcrumb-item">
14                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
15             </li>
16             [% IF ( loggedinusername ) %]
17                 <li class="breadcrumb-item">
18                     <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
19                 </li>
20             [% END %]
21             <li class="breadcrumb-item">
22                 <a href="/cgi-bin/koha/opac-shelves.pl">Lists</a>
23             </li>
24             <li class="breadcrumb-item active">
25                 <a href="#" aria-current="page">Share a list</a>
26             </li>
27         </ol> <!-- / .breadcrumb -->
28     </nav> <!-- /#breadcrumbs -->
29
30     <div class="container-fluid">
31         <div class="row">
32             [% IF ( OpacNav ) %]
33                 <div class="col-lg-2">
34                     <div id="navigation">
35                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
36                     </div>
37                 </div>
38             [% END %]
39
40             <div class="col-10 order-first order-md-first order-lg-2">
41                 <div id="shareshelf" class="maincontent">
42
43                     [%# This section contains the essential code for error messages and three operations: invite, confirm_invite and accept. %]
44                     <h1>Share a list with another patron</h1>
45
46                     [% IF errcode %]
47                         [% IF errcode==1 && op %]
48                             <div class="alert alert-warning">The operation [% op | html %] is not supported.</div>
49                         [% END %]
50                         [% IF errcode==1 && !op %]
51                             <div class="alert alert-warning">No operation parameter has been passed.</div>
52                         [% END %]
53                         [% IF errcode==2 %]
54                             <div class="alert alert-warning">Invalid shelf number.</div>
55                         [% END %]
56                         [% IF errcode==3 %]
57                             <div class="alert alert-warning">The feature of sharing lists is not in use in this library.</div>
58                         [% END %]
59                         [% IF errcode==4 %]
60                             <div class="alert alert-warning">You can only share a list if you are the owner.</div>
61                         [% END %]
62                         [% IF errcode==5 %]
63                             <div class="alert alert-warning">You cannot share a public list.</div>
64                         [% END %]
65                         [% IF errcode==6 %]
66                             <div class="alert alert-warning">Sorry, but you did not enter a valid email address.</div>
67                         [% END %]
68                         [% IF errcode==7 %]
69                             <div class="alert alert-warning">Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.</div>
70                         [% END %]
71                         [% IF errcode==8 %]
72                             <div class="alert alert-warning">As owner of a list you cannot accept an invitation for sharing it.</div>
73                         [% END %]
74                         <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list">Return to your lists</a></p>
75
76                     [% ELSIF op=='invite' %]
77                         <div id="invite">
78                             <form id="share_list">
79                                 <legend class="sr-only">Share list</legend>
80                                 <fieldset class="rows">
81                                     <input type="hidden" name="op" value="conf_invite"/>
82                                     <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]"/>
83                                     <ol>
84                                         <li>
85                                             <label for="name">List name:</label> [% shelfname | html %]
86                                         </li>
87                                         <li>
88                                             <label for="invite_address">Email address:</label>
89                                             <input type="text" id="invite_address" name="invite_address" size="40" />
90                                         </li>
91                                     </ol>
92                                 </fieldset>
93                                 <fieldset class="action">
94                                     <input type="submit" value="Send" class="btn btn-primary" />
95                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=list" class="cancel">Cancel</a>
96                                 </fieldset>
97                             </form> <!-- /#share_list -->
98                         </div> <!-- /#invite -->
99
100                     [% ELSIF op=='conf_invite' %]
101                         <div id="conf_invite">
102                             [% IF approvedaddress %]
103                                 <p>An invitation to share list <em>[% shelfname | html %]</em> will be sent shortly to [% approvedaddress | html %].</p>
104                             [% END %]
105                             [% IF failaddress %]
106                                 <p>Something went wrong while processing the following addresses. Please check them. These are: [% failaddress | html %]</p>
107                             [% END %]
108                             [% IF approvedaddress %]
109                                 <p>You will receive an email notification if someone accepts your share before it expires.</p>
110                             [% END %]
111                             <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list">Return to your lists</a></p>
112                         </div>
113
114                     [% ELSIF op=='accept' %]
115                         [%# Nothing to do: we already display an error or we redirect. %]
116                     [% END %]
117                     [%# End of essential part %]
118
119                 </div> <!-- / #shareshelf.maincontent -->
120             </div> <!-- / .span10 -->
121         </div> <!-- / .row -->
122     </div> <!-- / .container-fluid -->
123 </div> <!-- / .main -->
124
125 [% INCLUDE 'opac-bottom.inc' %]
126 [% BLOCK jsinclude %]
127     <script>
128         $(document).ready(function(){
129             $("#share_list").on('submit', function(e) {
130                 var address = $("#invite_address").val();
131                 if ( address.length == 0) {
132                     e.preventDefault();
133                 }
134             });
135         });
136     </script>
137 [% END %]