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