Debrand the login form
authorDan Scott <dan@coffeecode.net>
Mon, 2 May 2011 01:25:38 +0000 (21:25 -0400)
committerDan Scott <dan@coffeecode.net>
Mon, 2 May 2011 01:25:38 +0000 (21:25 -0400)
Breaking the password hint and login help sections out into
separate templates enables sites to adjust the hint and
login help links without touching the rest of the interface.

Signed-off-by: Dan Scott <dbs@coffeecode.net>

Open-ILS/web/templates/default/opac/parts/login/form.tt2
Open-ILS/web/templates/default/opac/parts/login/help.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/login/password_hint.tt2 [new file with mode: 0644]
Open-ILS/web/templates_kcls/default/opac/parts/login/form.tt2 [deleted file]
Open-ILS/web/templates_kcls/default/opac/parts/login/help.tt2 [new file with mode: 0644]

index c0624ae..b30d47f 100644 (file)
                         <tr>
                             <td valign="top" class="lbl1">
                                 [% l('PIN Number or Password') %]<br />
-                                <span class="lbl2">
-                                    [% | l('<br/>', '<br/>') %]
-                                       If this is your first time logging in, please enter [_1] the last 4 digits of your phone number. [_2] Example: 0926
-                                    [% END %]
-                                </span>
+                                [% INCLUDE "default/opac/parts/login/password_hint.tt2" %]
                             </td>
                             <td valign="top">
                                 <div class="input_bg">
                     <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="[% l('Questions?') %]" style="margin-top:29px;" /></a>
-
-                       <div style="width:182px;color:black;padding:5px 25px;">
-                        [% 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="[% l('FAQs') %]" src="[% ctx.media_prefix %]/images/faqs-btn.png" style="margin-top:13px;" /></a>
-                   </td>
+                [% INCLUDE "default/opac/parts/login/help.tt2" %]
             </tr>
         </table>
     </form>
diff --git a/Open-ILS/web/templates/default/opac/parts/login/help.tt2 b/Open-ILS/web/templates/default/opac/parts/login/help.tt2
new file mode 100644 (file)
index 0000000..16db31f
--- /dev/null
@@ -0,0 +1,12 @@
+<td class="login_boxes right_brain" align="center" valign="top" width="291">
+
+    <a href="http://example.com"><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;">
+        [% l('Visit our FAQs section for answers to common questions about how to use your account.') %]
+    </div>
+
+    <a href="http://example.com"><img
+        alt="[% l('FAQs') %]" src="[% ctx.media_prefix %]/images/faqs-btn.png" style="margin-top:13px;" /></a>
+</td>
diff --git a/Open-ILS/web/templates/default/opac/parts/login/password_hint.tt2 b/Open-ILS/web/templates/default/opac/parts/login/password_hint.tt2
new file mode 100644 (file)
index 0000000..a95b47f
--- /dev/null
@@ -0,0 +1,5 @@
+<span class="lbl2">
+    [% | l('<br/>', '<br/>') %]
+       If this is your first time logging in, please enter [_1] the last 4 digits of your phone number. [_2] Example: 0926
+    [% END %]
+</span>
diff --git a/Open-ILS/web/templates_kcls/default/opac/parts/login/form.tt2 b/Open-ILS/web/templates_kcls/default/opac/parts/login/form.tt2
deleted file mode 100644 (file)
index c0624ae..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-<!-- 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>
-       </div>
-       <br/>
-</div>
-<div class="hide_me" id="forget_pw">
-    <h1>Password Reset</h1>
-       Username or Barcode<br />
-       <input type="text" id="forget_pw_user" /><br /><br />
-       Email Address on account<br />
-       <input type="text" id="forget_pw_email" /><br />
-    <a href="#">Submit</a> &nbsp;
-    <a href="#">Cancel</a>
-</div>
-<table id='change_pw_table' class='data_grid hide_me' style='margin-left: 20px;' width='95%'>
-       <thead>
-        <tr><td colspan='2' align='center'><b>[% l("Password") %]</b></td></tr>
-    </thead>
-    <tbody>
-        <tr>
-            <td colspan='2' style='padding:10px;'>
-                [% l("This appears to be the first time you have logged in.  You will need to change your password.") %]
-                [% 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.") %]
-            </td>
-        </tr>
-        <tr>
-            <td>[% l("Enter your current password") %]</td>
-            <td><input type='password' id='change_pw_current'/></td>
-        </tr>
-        <tr>
-            <td>[% l("Enter the new password") %]</td>
-            <td><input type='password' id='change_pw_1'/></td>
-        </tr>
-        <tr>
-            <td>[% l("Re-type the new password for verification") %]</td>
-            <td><input type='password' id='change_pw_2'/></td>
-        </tr>
-        <tr><td><br/></td><td/></tr>
-        <tr class='color_1'>
-            <td colspan='2' align='center'>
-                <span class='login_text' style='margin-right: 20px;'>
-                    <input type='submit' value='[% l("Update Password") %]'  id='change_pw_button'/>
-                </span>
-            </td>
-        </tr>
-    </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.") %]
-</span>
-
- ^== TODO: MOVE INTO SEPARATE FORGOT-PASSWORD PAGE  -->
-
-[% IF ctx.login_failed_event %]
-<div id='login-failed-message'>
-[%
-    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;
-%]
-</div>
-[% END %]
-
-<div>
-    <div style="height:20px;"></div>
-    <form method='POST'>
-        <table cellpadding="0" cellspacing="0" border="0">
-            <tr>
-                <td valign="top" width="676" class="login_boxes left_brain">
-                    <table cellpadding="0" cellspacing="0" border="0"
-                        width="100%">
-                        <tr>
-                               <td colspan="2" style="padding-bottom: 10px;">
-                                <h1>[% l('Log in to Your Account') %]</h1>
-                                [% l('Please enter the following information:') %]
-                                <br /><br />
-                            </td>
-                        </tr>
-                        <tr>
-                            <td width="42%" class="lbl1">
-                                [% l('Library Card Number or Username') %]
-                                <br />
-                                <span class="lbl2">
-                                    [% 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" id="username_field" name="username"/>
-                                </div>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td colspan="2">
-                                <div style="height:15px;"></div>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td valign="top" class="lbl1">
-                                [% l('PIN Number or Password') %]<br />
-                                <span class="lbl2">
-                                    [% | l('<br/>', '<br/>') %]
-                                       If this is your first time logging in, please enter [_1] the last 4 digits of your phone number. [_2] Example: 0926
-                                    [% END %]
-                                </span>
-                            </td>
-                            <td valign="top">
-                                <div class="input_bg">
-                                    <input name="password" type="password" />
-                                </div>
-                                <div style="padding-top:7px;">
-                                    [%
-                                        # If no redirect is offered or it's leading us back to the 
-                                        # login form, redirect the user to My Account
-                                        redirect = CGI.param('redirect_to') || ctx.referer;
-                                        IF !redirect OR redirect.match(ctx.path_info _ '$');
-                                            redirect = CGI.url('-full' => 1) _ '/opac/myopac/main';
-                                        END;
-                                        redirect = redirect  | replace('^http:', 'https:');
-                                    %]
-                                    <input type='hidden' name='redirect_to' value='[% redirect %]'/>
-                                    <input type="checkbox" name="persist" /> [% l('Remember Me?') %]
-                                </div>
-                                <div style="padding-top:14px;">
-                                    <input type='image' alt="[% l('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>
-                    </table>
-                    <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="[% l('Questions?') %]" style="margin-top:29px;" /></a>
-
-                       <div style="width:182px;color:black;padding:5px 25px;">
-                        [% 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="[% 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>
diff --git a/Open-ILS/web/templates_kcls/default/opac/parts/login/help.tt2 b/Open-ILS/web/templates_kcls/default/opac/parts/login/help.tt2
new file mode 100644 (file)
index 0000000..a6d7ebb
--- /dev/null
@@ -0,0 +1,12 @@
+<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;">
+        [% 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="[% l('FAQs') %]" src="[% ctx.media_prefix %]/images/faqs-btn.png" style="margin-top:13px;" /></a>
+</td>