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