login form cleanup and implementation of login-failure handling; more to come
authorBill Erickson <erickson@esilibrary.com>
Thu, 10 Feb 2011 17:25:29 +0000 (12:25 -0500)
committerBill Erickson <erickson@esilibrary.com>
Thu, 10 Feb 2011 17:25:29 +0000 (12:25 -0500)
Open-ILS/web/templates/default/opac/parts/login/form.tt2

index e140bcb..939cd17 100644 (file)
@@ -1,4 +1,6 @@
-<!-- ****************** login.xml ***************************** -->
+
+
+<!-- TODO: MOVE INTO SEPARATE FORGOT-PASSWORD PAGE 
 <div class="hide_me">
        <div class='login_text color_1' style='padding: 4px; text-align: center;'>
                <span>[% l("Login") %]</span>
     </tbody>
 </table>
 
+
 <span id='pw_no_match' class='hide_me'>[% l("Passwords do not match") %]</span>
 <span id='pw_update_successful' class='hide_me'>[% l("Password successfully updated") %]</span>
 <span id='pw_not_strong' class='hide_me'>
     [% l("The password provided is not strong enough.") %]
-    [% l("The password must be at least 7 characters in length,
- contain at least one letter (a-z/A-Z),
- and contain at least one number.") %]
+    [% l("The password must be at least 7 characters in length, contain at least one letter (a-z/A-Z), and contain at least one number.") %]
 </span>
-<span id='patron_card_inactive_alert' class='hide_me'>[% l("The barcode used to login is marked as inactive.  Please contact your local library.") %]</span>
-<span id='patron_inactive_alert' class='hide_me'>[% l("This account has been deactivated.  Please contact your local library.") %]</span>
-<span id='patron_login_failed' class='hide_me'>[% l("Login failed. The username or password provided was not valid.  Ensure Caps-Lock is off and try again or contact your local library.") %]</span>
 
-<div id="login_box">
+ ^== TODO: MOVE INTO SEPARATE FORGOT-PASSWORD PAGE  -->
+
+
+[% IF ctx.login_failed_event;
+    IF ctx.login_failed_event.textcode == 'PATRON_CARD_INACTIVE';
+        l("The barcode used to login is marked as inactive.  Please contact your local library.");
+    ELSIF ctx.login_failed_event.textcode == 'PATRON_INACTIVE';
+        l("This account has been deactivated.  Please contact your local library.");
+    ELSE;
+        l("Login failed. The username or password provided was not valid.  Ensure Caps-Lock is off and try again or contact your local library.");
+    END;
+END %]
+
+
+<div>
     <div style="height:20px;"></div>
-    <form id='login_form' method='POST'>
+    <form method='POST'>
         <table cellpadding="0" cellspacing="0" border="0">
             <tr>
                 <td valign="top" width="676" class="login_boxes left_brain">
                         </tr>
                         <tr>
                             <td width="42%" class="lbl1">
-                                Library Card Number or Username<br />
+                                [% l('Library Card Number or Username') %]
+                                <br />
                                 <span class="lbl2">
-                                    Please include leading zeros and no spaces.
-                                    <br /> Example: 0026626051</span>
+                                    [% l('Please include leading zeros and no spaces.') %]
+                                    <br/>
+                                    [% l('Example: 0026626051') %]
+                                </span>
                                 <br /><br />
                             </td>
                             <td width="58%" valign="top">
                                 <div class="input_bg">
-                                    <input type="text" name="username"
-                                        id="login_username" />
+                                    <input type="text" name="username"/>
                                 </div>
                             </td>
                         </tr>
                         </tr>
                         <tr>
                             <td valign="top" class="lbl1">
-                                PIN Number or Password<br />
-                                <span class="lbl2">If this is your first time
-                                    logging in, please enter<br />
-                                    the last 4 digits of your phone number.<br />
-                                    Example: 0926</span>
+                                [% l('PIN Number or Password') %]<br />
+                                <span class="lbl2">
+                                    [% l('If this is your first time logging in, please enter [_1] the last 4 digits of your phone number. [_2] Example: 0926', '<br/>', '<br/>') %]
+                                </span>
                             </td>
                             <td valign="top">
                                 <div class="input_bg">
-                                    <input name="password" type="password" id="login_password" />
+                                    <input name="password" type="password" />
                                 </div>
                                 <div style="padding-top:7px;">
                                     <input type='hidden'
                                         name='redirect_to'
                                         value='[% CGI.param('redirect_to') || ctx.referer | replace('^http:', 'https:') %]' />
-                                    <input class="hide_me" type="checkbox"
-                                        id="remember_me" name="remember_me" />
-                                    <label class="hide_me"
-                                        style="position:relative;top:-2px;"
-                                        for="remember_me">Remember Me?</label>
+                                    <input type="checkbox" name="persist" /> [% l('Remember Me?') %]
                                 </div>
                                 <div style="padding-top:14px;">
-                                    <a href="#" id="login_button"><img
-                                        alt="Log in" src="[% ctx.media_prefix %]/images/login-btn2.png" /></a>
-                                    <input class="hide_me"
-                                        id="login_form_submit" type="submit" />
-                                    <a href="#"
+                                    <input type='image' alt="Log in" src="[% ctx.media_prefix %]/images/login-btn2.png" />
+                                    <!-- TODO
+                                    <a href="reset_password"
                                         style="position:relative;top:-13px;left:2px;font-size:10px;">Forgot your PIN?</a>
+                                    -->
                                 </div>
                                </td>
                         </tr>
                     <br /><br />
                 </td>
                    <td><div style="width:10px;"></div></td>
-                <td class="login_boxes right_brain" align="center"
-                    valign="top" width="291">
-                    <a href="http://www.kcls.org/about/contact/"><img
-                        src="[% ctx.media_prefix %]/images/questions.png"
-                        alt="Questions?" style="margin-top:29px;" /></a>
+                <td class="login_boxes right_brain" align="center" valign="top" width="291">
+
+                    <a href="http://www.kcls.org/about/contact/"><img 
+                        src="[% ctx.media_prefix %]/images/questions.png" alt="[% l('Questions?') %]" style="margin-top:29px;" /></a>
+
                        <div style="width:182px;color:black;padding:5px 25px;">
-                        Visit our FAQs section for answers to common questions
-                        about how to use your account.
+                        [% l('Visit our FAQs section for answers to common questions about how to use your account.') %]
                        </div>
+
                     <a href="http://www.kcls.org/usingthelibrary/catalog_help/index.cfm#FAQs"><img
-                        alt="FAQs" src="[% ctx.media_prefix %]/images/faqs-btn.png"
-                        style="margin-top:13px;" /></a>
+                        alt="[% l('FAQs') %]" src="[% ctx.media_prefix %]/images/faqs-btn.png" style="margin-top:13px;" /></a>
                    </td>
             </tr>
         </table>
     </form>
     <div class="clear-both"></div>
 </div>
-<!-- ****************** end: login.xml ***************************** -->