Bug 28242: added captions to tables and legends to forms
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-password-recovery.tt
1 [% USE Koha %]
2 [% USE Categories %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Forgotten password recovery &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
7 [% BLOCK jsinclude %]
8 [% IF (new_password) %]
9     [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
10     [% PROCESS 'password_check.inc' new_password => 'newPassword', minPasswordLength => minPasswordLength, RequireStrongPassword => RequireStrongPassword %]
11 [% END %]
12     <script>
13     $(function() {
14             $("#CheckAll").click(function(){
15                     $("[name=deleteRequest]").attr('checked', true);
16                     return false;
17                 });
18
19             $("#CheckNone").click(function(){
20                     $("[name=deleteRequest]").attr('checked', false);
21                     return false;
22                 });
23
24             $("select#type").change(function() {
25                 $("fieldset#serial, fieldset#book, fieldset#chapter").hide()
26                 $("fieldset#" + $(this).val() ).show();
27             });
28         [% IF (new_password) %]
29             $("#mainform").validate({
30                 rules: {
31                     newPassword: {
32                         required: true,
33                         password_strong: true,
34                         password_no_spaces: true
35                     },
36                     repeatPassword: {
37                         required: true,
38                         password_match: true
39                     }
40                 }
41             });
42         [% END %]
43     });
44     </script>
45 [% END %]
46 </head>
47 [% INCLUDE 'bodytag.inc' bodyid='opac-password-recovery' %]
48 [% INCLUDE 'masthead.inc' %]
49
50 <div class="main">
51     <nav aria-label="breadcrumb">
52         <ul class="breadcrumb">
53             <li class="breadcrumb-item">
54                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
55             </li>
56             <li class="breadcrumb-item" aria-current="page">
57                 <a href="#">Forgotten password recovery</a>
58             </li>
59         </ul>
60     </nav>
61
62     <div class="container-fluid">
63         <div class="row">
64             <div class="col-lg-2">
65                 [% IF ( OpacPublic ) %]
66                     <div id="navigation">
67                         [% INCLUDE 'navigation.inc' IsPatronPage=0 %]
68                     </div>
69                 [% END %]
70             </div>
71             <div class="col-6 order-first order-md-first order-lg-2 maincontent">
72                 <h1>Forgotten password recovery</h1>
73                 [% IF (hasError) %]
74                     <div class="alert alert-warning">
75                         <h2>Error</h2>
76                         <p>
77                         [% IF (sendmailError) %]
78                             An error has occurred while sending you the password recovery link.
79                             <br/>Please try again later.
80                         [% ELSIF (errNoBorrowerFound) %]
81                             No account was found with the provided information.
82                         [% ELSIF errResetForbidden %]
83                             <span id="password-reset-forbidden">Sorry, your password cannot be changed online.</span>
84                         [% ELSIF (errMultipleAccountsForEmail) %]
85                             Account identification with this email address only is ambiguous.
86                             <br />Please use the field 'Login' as well.
87                         [% ELSIF (errNoBorrowerEmail) %]
88                             This account has no email address we can send the email to.
89                         [% ELSIF (errAlreadyStartRecovery) %]
90                             The process of password recovery has already been started for this account
91                             [% IF username %]
92                                 ("<strong>[% username | html %]</strong>")
93                             [% ELSIF email %]
94                                 ("<strong>[% email | html %]</strong>")
95                             [% END %]
96                             <br/>You should have received an email with a link to reset your password.
97                             <br/>If you did not receive this email, you can request a new one: <a href="/cgi-bin/koha/opac-password-recovery.pl?resendEmail=true&email=[% email | uri %]&username=[% username | uri %]">Get new password recovery link</a>
98                         [% ELSIF (errPassNotMatch) %]
99                             The passwords do not match.
100                         [% ELSIF password_too_short %]
101                             <li>Password must be at least [% minPasswordLength | html %] characters long.</li>
102                         [% ELSIF password_too_weak %]
103                             <li>Password must contain at least one digit, one lowercase and one uppercase.</li>
104                         [% ELSIF password_has_whitespaces %]
105                             <li>Password must not contain leading or trailing whitespaces.</li>
106                         [% ELSIF (errLinkNotValid) %]
107                             The link you clicked is either invalid, or expired.
108                             <br/>Be sure you used the link from the email, or contact library staff for assistance.
109                         [% END %]
110                         </p>
111                         <p>Please contact the library if you need further assistance.</p>
112                     </div> <!-- /div.alert.alert-warning -->
113                 [% END # /IF hasError %]
114
115                 <div id="password-recovery">
116                     [% IF (! Categories.can_any_reset_password ) %]
117                         <div class="alert alert-info">You can't reset your password.</div>
118                     [% ELSIF (password_recovery) %]
119                         <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
120                             <legend class="sr-only">Password recovery</legend>
121                             <input type="hidden" name="koha_login_context" value="opac" />
122                             <p>To reset your password, enter your login or your email address.</p>
123                             <fieldset class="brief">
124                                 <div class="form-group">
125                                     <label for="username">Login:</label>
126                                     <input class="form-control" type="text" id="username" size="40" name="username" value="[% username | html %]" />
127                                 </div>
128
129                                 <div class="form-group">
130                                     <label for="email">Email:</label>
131                                     <input class="form-control" type="text" id="email" size="40" name="email" value="[% email | html %]" />
132                                 </div>
133
134                                 <fieldset class="action">
135                                     <input type="submit" value="Submit" class="btn btn-primary" name="sendEmail" />
136                                 </fieldset>
137                             </fieldset>
138                         </form>
139                     [% ELSIF (new_password) %]
140                         [% UNLESS ( errLinkNotValid ) %]
141                             <form id="mainform" name="mainform" action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
142                                 <legend class="sr-only">Password not valid</legend>
143                                 <input type="hidden" name="koha_login_context" value="opac" />
144                                 <fieldset class="brief">
145                                     [% IF ( RequireStrongPassword ) %]
146                                         <div class="alert alert-info">Your password must contain at least [% minPasswordLength | html %] characters, including UPPERCASE, lowercase and numbers.</div>
147                                     [% ELSE %]
148                                         <div class="alert alert-info">Your password must be at least [% minPasswordLength | html %] characters long.</div>
149                                     [% END %]
150                                     <div class="form-group">
151                                         <label for="newPassword">New password:</label>
152                                         <input class="form-control" type="password" id="newPassword" size="40" name="newPassword" />
153                                     </div>
154
155                                     <div class="form-group">
156                                         <label for="repeatPassword">Confirm new password:</label>
157                                         <input class="form-control" type="password" id="repeatPassword" size="40" name="repeatPassword" />
158                                     </div>
159
160                                     <fieldset class="action">
161                                         <input type="hidden" name="username" value="[% username | html %]" />
162                                         <input type="hidden" name="uniqueKey" value="[% uniqueKey | html %]" />
163                                         <input type="submit" value="Submit" class="btn btn-primary" name="passwordReset" />
164                                     </fieldset>
165                                 </fieldset>
166                             </form>
167                         [% END # /UNLESS errLinkNotValid %]
168                     [% ELSIF (mail_sent) %]
169                         <div class="alert alert-info">
170                             <p>
171                                 You will receive an email shortly.
172                                 <br/>Please click the link in this email to finish the process of resetting your password.
173                                 <br/>This link is valid for 2 days starting now.
174                             </p>
175                             <a href="/cgi-bin/koha/opac-main.pl">Return to the main page</a>
176                         </div>
177                     [% ELSIF (password_reset_done) %]
178                         <div class="alert alert-success">
179                             <p>The password has been changed for user "[% username | html %]".</p>
180                             <a href="/cgi-bin/koha/opac-user.pl">Log in to your account.</a>
181                         </div>
182                     [% END # /IF (! Categories.can_any_reset_password ) %]
183                 </div><!-- / #password-recovery -->
184             </div><!-- / .span10 -->
185         </div><!-- / .row-fluid -->
186     </div><!-- / .container-fluid -->
187 </div><!-- / .main -->
188 [% INCLUDE 'opac-bottom.inc' %]