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 › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
10 [% INCLUDE 'bodytag.inc' bodyid='opac-shareshelf' bodyclass='scrollto' %]
11 [% INCLUDE 'masthead.inc' %]
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>
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>
23 <li class="breadcrumb-item">
24 <a href="/cgi-bin/koha/opac-shelves.pl">Lists</a>
26 <li class="breadcrumb-item active">
27 <a href="#" aria-current="page">Share a list</a>
29 </ol> <!-- / .breadcrumb -->
30 </nav> <!-- /#breadcrumbs -->
32 <div class="container-fluid">
35 <div class="col-lg-2">
37 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
42 <div class="col-10 order-first order-md-first order-lg-2">
43 <div id="shareshelf" class="maincontent">
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>
49 [% IF errcode==1 && op %]
50 <div class="alert alert-warning">The operation [% op | html %] is not supported.</div>
52 [% IF errcode==1 && !op %]
53 <div class="alert alert-warning">No operation parameter has been passed.</div>
56 <div class="alert alert-warning">Invalid shelf number.</div>
59 <div class="alert alert-warning">The feature of sharing lists is not in use in this library.</div>
62 <div class="alert alert-warning">You can only share a list if you are the owner.</div>
65 <div class="alert alert-warning">You cannot share a public list.</div>
68 <div class="alert alert-warning">Sorry, but you did not enter a valid email address.</div>
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>
74 <div class="alert alert-warning">As owner of a list you cannot accept an invitation for sharing it.</div>
76 <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list">Return to your lists</a></p>
78 [% ELSIF op=='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 %]"/>
87 <label for="name">List name:</label> [% shelfname | html %]
90 <label for="invite_address">Email address:</label>
91 <input type="text" id="invite_address" name="invite_address" size="40" />
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>
99 </form> <!-- /#share_list -->
100 </div> <!-- /#invite -->
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>
108 <p>Something went wrong while processing the following addresses. Please check them. These are: [% failaddress | html %]</p>
110 [% IF approvedaddress %]
111 <p>You will receive an email notification if someone accepts your share before it expires.</p>
113 <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list">Return to your lists</a></p>
116 [% ELSIF op=='accept' %]
117 [%# Nothing to do: we already display an error or we redirect. %]
119 [%# End of essential part %]
121 </div> <!-- / #shareshelf.maincontent -->
122 </div> <!-- / .span10 -->
123 </div> <!-- / .row -->
124 </div> <!-- / .container-fluid -->
125 </div> <!-- / .main -->
127 [% INCLUDE 'opac-bottom.inc' %]
128 [% BLOCK jsinclude %]
130 $(document).ready(function(){
131 $("#share_list").on('submit', function(e) {
132 var address = $("#invite_address").val();
133 if ( address.length == 0) {