LP#1977554: (follow-up) remove "switch" role
[evergreen-equinox.git] / Open-ILS / src / templates-bootstrap / opac / parts / login / login_modal.tt2
1 <div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-hidden="true">
2   <div class="modal-dialog modal-dialog-centered" role="document">
3     <div class="modal-content">
4      <form id="login_form" method='post' action="/eg/opac/login?redirect_to=%2Feg%2Fopac%2Fmyopac%2Fmain">
5       <div class="modal-header">
6         <h1 class="modal-title" id="exampleModalLabel">[% l('Login To Evergreen') %]</h1>
7         <button type="button" class="close" data-dismiss="modal" aria-label=[% l("Close") %]>
8           <i class="fas fa-times" aria-hidden="true"></i>
9         </button>
10       </div>
11       <div class="modal-body">
12
13       [% IF ctx.login_failed_event %]
14     <div id='login-failed-message'>
15     [%
16         IF ctx.login_failed_event.textcode == 'PATRON_CARD_INACTIVE';
17             l("The barcode used to login is marked as inactive.  Please contact your local library.");
18         ELSIF ctx.login_failed_event.textcode == 'PATRON_INACTIVE';
19             l("This account has been deactivated.  Please contact your local library.");
20         ELSE;
21             l("Login failed. The username or password provided was not valid. " _
22                "Passwords are case-sensitive.  Check your Caps-Lock key and try again or contact your local library.");
23         END;
24     %]
25     </div>
26     [% END %]
27
28 <div class='container'>
29         <div class="table table-borderless table-sm">
30                 <div class="row">
31                         <div class="col-sm w-50">
32                                 <label for='username_field' class="lbl1" >[% l('Library Card Number') %]
33                                 <a href="#" title="[% INCLUDE "opac/parts/login/username_hint.tt2" %]" data-html="true" data-toggle="tooltip">
34                                 <i class="fas fa-question-circle"></i></a></label>
35                         </div>
36                         <div class="col-sm w-50">
37                                 <label for="password_field" class="lbl1" >[% l('PIN') %]
38                                 <a href="#" title="[% INCLUDE "opac/parts/login/password_hint.tt2" %]" data-html="true" data-toggle="tooltip">
39                 <i class="fas fa-question-circle"></i>
40                 </a></label>
41                         </div>
42                 </div>
43                 <div class="row">
44                         <div class="col-sm w-50">
45                                 <input class="form-control" type='text' id="username_field" name="username"/>
46                         </div>
47                         <div class="col-sm w-50">
48                 <div class="input-group">
49                     <input class="form-control" id="password_field" name="password" type="password"
50                                                    spellcheck="false" autocomplete="false" autocapitalize="none" aria-description="Your password is not visible."/>
51                                         <span class="input-group-addon">
52                       <button id="show_password" class="btn" type="button" aria-label="password visibility"
53                                                           aria-checked="false" ><i class="fas fa-eye-slash"></i>
54                                           </button>
55                     </span>
56                 </div>
57                         </div>
58                 </div>
59                 <div class="row">
60                         <div class="col-sm w-50">
61                             [% IF ctx.get_org_setting(
62                                 ctx.physical_loc || ctx.aou_tree.id, 'opac.allow_pending_user') %]
63                                 <a href='[% mkurl(ctx.opac_root _ '/register', {}, 1) %]'>[% l('Request A Card') %]</a>
64                             [% END %]
65                         </div>
66                         <div class="col-sm w-50">
67                                 [% IF reset_password == 'true' %]
68                                 <a href='[% mkurl(ctx.opac_root _ '/password_reset', {}, 1) %]'>[% l('Forgot Your Password?') %]  </a>
69                                 [% END %]
70                         </div>
71                 </div>
72         </div>
73
74     <div class="mx-auto row py-4">
75
76         <div style="clear: both; padding-top: 15px;" class="col-12">
77         [%
78             redirect = CGI.param('redirect_to');
79             # Don't use referer unless we got here from elsewhere within the TPAC
80             IF !redirect AND ctx.referer.match('^https?://' _ ctx.hostname _ ctx.opac_root);
81                 redirect = ctx.referer;
82             END;
83             # If no redirect is offered or it's leading us back to the
84             # login form, redirect the user to My Account
85             IF !redirect OR redirect.match(ctx.path_info _ '$');
86                 redirect = CGI.url('-full' => 1) _ '/opac/myopac/main';
87             END;
88                 redirect = redirect  | replace('^http:', 'https:');
89             %]
90         </div>
91
92         <input id="client_tz_id" name="client_tz" type="hidden" />
93         </div>
94   </div>
95     [%# INCLUDE "opac/parts/login/help.tt2" %]
96
97       </div>
98       <div class="modal-footer">
99       <div class="mr-auto">
100         <input type='hidden' name='redirect_to' value='[% redirect | html %]'/>
101         <input type="checkbox" name="persist" id="login_persist" class="mr-1"/>
102         <label for="login_persist"> [% l('Stay logged in?') %]</label>
103       </div>
104
105         <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fas fa-times" aria-hidden="true"></i> [% l('Close') %]</button>
106         <button type="submit" class="btn btn-confirm"><i class="fas fa-sign-in-alt" aria-hidden="true"></i> [% l('Log in') %]</button>
107       </div>
108       </form>
109     </div>
110   </div>
111 </div>