Bug 27742: Page titles have unique info first
[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 aria-label="breadcrumb">
12         <ul 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" aria-current="page">
25                 Share a list
26             </li>
27         </ul> <!-- / .breadcrumb -->
28     </nav>
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                     <h2>Share a list with another patron</h2>
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&amp;category=1">Return to your lists</a></p>
75
76                     [% ELSIF op=='invite' %]
77                         <div id="invite">
78                             <form id="share_list">
79                                 <fieldset class="rows">
80                                     <input type="hidden" name="op" value="conf_invite"/>
81                                     <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]"/>
82                                     <ol>
83                                         <li>
84                                             <label for="name">List name:</label> [% shelfname | html %]
85                                         </li>
86                                         <li>
87                                             <label for="invite_address">Email address:</label>
88                                             <input type="text" id="invite_address" name="invite_address" size="40" />
89                                         </li>
90                                     </ol>
91                                 </fieldset>
92                                 <fieldset class="action">
93                                     <input type="submit" value="Send" class="btn btn-primary" />
94                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" class="cancel">Cancel</a>
95                                 </fieldset>
96                             </form> <!-- /#share_list -->
97                         </div> <!-- /#invite -->
98
99                     [% ELSIF op=='conf_invite' %]
100                         <div id="conf_invite">
101                             [% IF approvedaddress %]
102                                 <p>An invitation to share list <em>[% shelfname | html %]</em> will be sent shortly to [% approvedaddress | html %].</p>
103                             [% END %]
104                             [% IF failaddress %]
105                                 <p>Something went wrong while processing the following addresses. Please check them. These are: [% failaddress | html %]</p>
106                             [% END %]
107                             [% IF approvedaddress %]
108                                 <p>You will receive an email notification if someone accepts your share before it expires.</p>
109                             [% END %]
110                             <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1">Return to your lists</a></p>
111                         </div>
112
113                     [% ELSIF op=='accept' %]
114                         [%# Nothing to do: we already display an error or we redirect. %]
115                     [% END %]
116                     [%# End of essential part %]
117
118                 </div> <!-- / #shareshelf.maincontent -->
119             </div> <!-- / .span10 -->
120         </div> <!-- / .row -->
121     </div> <!-- / .container-fluid -->
122 </div> <!-- / .main -->
123
124 [% INCLUDE 'opac-bottom.inc' %]
125 [% BLOCK jsinclude %]
126     <script>
127         $(document).ready(function(){
128             $("#share_list").on('submit', function(e) {
129                 var address = $("#invite_address").val();
130                 if ( address.length == 0) {
131                     e.preventDefault();
132                 }
133             });
134         });
135     </script>
136 [% END %]