Bug 27610: Changed pages of OPAC to have a <h1>
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-passwd.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Change your password &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 [% INCLUDE 'bodytag.inc' bodyid='opac-passwd' %]
10 [% INCLUDE 'masthead.inc' %]
11
12 <div class="main">
13     <nav aria-label="breadcrumb">
14         <ul class="breadcrumb">
15             <li class="breadcrumb-item">
16                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
17             </li>
18             <li class="breadcrumb-item">
19                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
20             </li>
21             <li class="breadcrumb-item active" aria-current="page">
22                 <a href="#">Change your password</a>
23             </li>
24         </ul>
25     </nav>
26
27     <div class="container-fluid">
28         <div class="row">
29             <div class="col-lg-2">
30                 <div id="navigation">
31                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
32                 </div>
33             </div>
34             <div class="col-10 order-first order-lg-2">
35                 <div id="userpasswd" class="maincontent">
36                     <h1>Change your password </h1>
37
38                     [% IF ( Error_messages ) %]
39                         <div class="alert alert-warning">
40                             <h3>There was a problem with your submission</h3>
41                             <p>
42                                 [% IF ( passwords_mismatch ) %]
43                                 Passwords do not match.  Please re-type your new password.
44                                 [% END %]
45                                 [% IF password_too_short %]
46                                     Password must be at least [% minPasswordLength | html %] characters long.
47                                 [% END %]
48                                 [% IF password_too_weak %]
49                                     Password must contain at least one digit, one lowercase and one uppercase.
50                                 [% END %]
51                                 [% IF password_has_whitespaces %]
52                                     Password must not contain leading or trailing whitespaces.
53                                 [% END %]
54
55                                 [% IF ( WrongPass ) %]
56                                 Your current password was entered incorrectly.  If this problem persists, please ask a librarian to reset your password for you.
57                                 [% END %]
58                             </p>
59                         </div>
60                     [% END # /IF Error_messages %]
61
62                     [% IF logged_in_user.category.effective_change_password %]
63                         [% IF ( Ask_data ) %]
64                             <form action="/cgi-bin/koha/opac-passwd.pl" name="mainform" id="mainform" method="post" autocomplete="off">
65                                 <fieldset>
66                                     [% IF ( logged_in_user.category.effective_require_strong_password ) %]
67                                         <div class="alert alert-info">Your password must contain at least [% logged_in_user.category.effective_min_password_length | html %] characters, including UPPERCASE, lowercase and numbers.</div>
68                                     [% ELSE %]
69                                         <div class="alert alert-info">Your password must be at least [% logged_in_user.category.effective_min_password_length | html %] characters long.</div>
70                                     [% END %]
71                                     <div class="form-group">
72                                         <label for="Oldkey">Current password:</label>
73                                         <input class="form-control focus" type="password" id="Oldkey" size="25"  name="Oldkey" />
74                                     </div>
75                                     <div class="form-group">
76                                         <label for="Newkey">New password:</label>
77                                         <input class="form-control" type="password" id="Newkey"  size="25"  name="Newkey" />
78                                     </div>
79                                     <div class="form-group">
80                                         <label for="Confirm">Re-type new password:</label>
81                                         <input class="form-control" type="password"  id="Confirm" size="25" name="Confirm" />
82                                     </div>
83                                 </fieldset>
84                                 <fieldset class="action">
85                                     <input type="submit" value="Change password" class="btn btn-primary" />
86                                     <a href="/cgi-bin/koha/opac-user.pl" class="cancel">Cancel</a>
87                                 </fieldset>
88                             </form>
89                         [% END # /IF Ask_data %]
90                     [% ELSE %]
91                         <div class="alert alert-warning">You can't change your password.</div>
92                     [% END # /IF logged_in_user.category.effective_change_password %]
93
94                     [% IF ( password_updated ) %]
95                         <div class="alert alert-info">
96                             <strong>Password updated</strong>
97                             <br />
98                             Your password has been changed
99                         </div>
100                         <form action="/cgi-bin/koha/opac-user.pl" method="post" autocomplete="off">
101                             <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
102                             <p><input type="submit" class="btn btn-primary" value="Return to my account" /></p>
103                         </form>
104                     [% END # /IF password_updated %]
105                 </div> <!-- / #userpasswd -->
106             </div> <!-- / .col-10 -->
107         </div> <!-- / .row -->
108     </div> <!-- / .container-fluid -->
109 </div> <!-- / .main -->
110
111
112
113 [% INCLUDE 'opac-bottom.inc' %]
114 [% BLOCK jsinclude %]
115     [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
116     [% PROCESS 'password_check.inc' new_password => 'Newkey', minPasswordLength => logged_in_user.category.effective_min_password_length, RequireStrongPassword => logged_in_user.category.effective_require_strong_password %]
117     <script>
118         $(document).ready(function() {
119             $("#mainform").validate({
120                 rules: {
121                     Newkey: {
122                         required: true,
123                         password_strong: true,
124                         password_no_spaces: true
125                     },
126                     Confirm: {
127                         required: true,
128                         password_match: true
129                     }
130                 }
131             });
132         });
133     </script>
134 [% END %]