Bug 14266: Trim the email address in the pl script
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-shareshelf.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Share a list
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% BLOCK cssinclude %][% END %]
5 </head>
6
7 [% INCLUDE 'bodytag.inc' bodyid='opac-shareshelf' bodyclass='scrollto' %]
8 [% INCLUDE 'masthead.inc' %]
9 <div class="main">
10     <ul class="breadcrumb">
11         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
12         [% IF ( loggedinusername ) %]
13             <li><a href="/cgi-bin/koha/opac-user.pl">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</a> <span class="divider">&rsaquo;</span></li>
14         [% END %]
15         <li>Share a list</li>
16     </ul> <!-- / .breadcrumb -->
17
18     <div class="container-fluid">
19         <div class="row-fluid">
20             [% IF ( OpacNav ) %]
21                 <div class="span2">
22                     <div id="navigation">
23                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
24                     </div>
25                 </div>
26             [% END %]
27
28 [%# This section contains the essential code for error messages and three operations: invite, confirm_invite and accept. %]
29     <h2>Share a list with another patron</h2>
30     <div class="span10">
31         <div id="shareshelf" class="maincontent">
32
33     [% IF errcode %]
34         [% IF errcode==1 && op %]<div class="alert">The operation [% op %] is not supported.</div>[% END %]
35         [% IF errcode==1 && !op %]<div class="alert">No operation parameter has been passed.</div>[% END %]
36         [% IF errcode==2 %]<div class="alert">Invalid shelf number.</div>[% END %]
37         [% IF errcode==3 %]<div class="alert">The feature of sharing lists is not in use in this library.</div>[% END %]
38         [% IF errcode==4 %]<div class="alert">You can only share a list if you are the owner.</div>[% END %]
39         [% IF errcode==5 %]<div class="alert">You cannot share a public list.</div>[% END %]
40         [% IF errcode==6 %]<div class="alert">Sorry, but you did not enter a valid email address.</div>[% END %]
41         [% IF errcode==7 %]<div class="alert">Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.</div>[% END %]
42         [% IF errcode==8 %]<div class="alert">As owner of a list you cannot accept an invitation for sharing it.</div>[% END %]
43         <p><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Return to your lists</a></p>
44
45     [% ELSIF op=='invite' %]
46         <div id="invite">
47         <form id="share_list">
48         <fieldset class="rows">
49             <ol>
50             <input type="hidden" name="op" value="conf_invite"/>
51             <input type="hidden" name="shelfnumber" value="[% shelfnumber %]"/>
52             <li><label for="name">List name:</label> [% shelfname %]</li>
53             <li>
54                 <label for="invite_address">Email address:</label>
55                 <input id="invite_address" name="invite_address" size="40" />
56             </li>
57             </ol>
58         </fieldset>
59         <fieldset class="action">
60             <input type="submit" value="Send" class="btn" />
61             <a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" class="cancel">Cancel</a>
62         </fieldset>
63         </form>
64         </div>
65
66     [% ELSIF op=='conf_invite' %]
67         <div id="conf_invite">
68         [% IF approvedaddress %]
69         <p>An invitation to share list <i>[% shelfname %]</i> will be sent shortly to [% approvedaddress %].</p>
70         [% END %]
71         [% IF failaddress %]
72             <p>Something went wrong while processing the following addresses. Please check them. These are: [% failaddress %]</p>
73         [% END %]
74         [% IF approvedaddress %]
75         <p>You will receive an email notification if someone accepts your share within two weeks.</p>
76         [% END %]
77         <p><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Return to your lists</a></p>
78         </div>
79
80     [% ELSIF op=='accept' %]
81         [%# Nothing to do: we already display an error or we redirect. %]
82     [% END %]
83
84         </div> <!-- / .span10 -->
85     </div> <!-- / .maincontent -->
86 [%# End of essential part %]
87
88         </div> <!-- / .row-fluid -->
89     </div> <!-- / .container-fluid -->
90 </div> <!-- / .main -->
91 [% INCLUDE 'opac-bottom.inc' %]
92 [% BLOCK jsinclude %]
93 <script type="text/javascript">
94 //<![CDATA[
95     $(document).ready(function(){
96         $("#share_list").on('submit', function(e) {
97             var address = $("#invite_address").val();
98             if ( address.length == 0) {
99                 e.preventDefault();
100             }
101         });
102     });
103 //]]>
104 </script>
105 [% END %]