Slightly saner login form markup
authorDan Scott <dscott@laurentian.ca>
Thu, 30 Aug 2012 15:55:10 +0000 (11:55 -0400)
committerDan Scott <dscott@laurentian.ca>
Thu, 30 Aug 2012 17:11:08 +0000 (13:11 -0400)
Try to provide accessibility via label attributes and move from a
table-within-a-table layout to a single table for the form.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates_laurentian/opac/parts/login/form.tt2 [new file with mode: 0644]

diff --git a/Open-ILS/src/templates_laurentian/opac/parts/login/form.tt2 b/Open-ILS/src/templates_laurentian/opac/parts/login/form.tt2
new file mode 100644 (file)
index 0000000..1e23a98
--- /dev/null
@@ -0,0 +1,65 @@
+[% 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 id='login-form-box' class='login_boxes left_brain' style='float:left'>
+    <h1>[% l('Log in to Your Account') %]</h1>
+    [% l('Please enter the following information:') %]
+    <form method='POST'>
+        <table>
+            <tr>
+                <td style="width: 20em; vertical-align: top; padding-top: 1.5em;" class='lbl1'><label for='username_field'>[% l('Library Card Number or Username') %]</label>
+                    <div class="lbl2">[% l('Please include leading zeros and no spaces.') %]</div>
+                   <div class="lbl2">[% l('Example: 0026626051') %]</div>
+                </td>
+                <td style="vertical-align: top; padding-top: 1.5em;">
+                    <div class="input_bg">
+                        <input type="text" id="username_field" name="username" autofocus />
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <td class="lbl1" style="width: 20em; vertical-align: top; padding-top: 1.5em">
+                    <label for="password_field">[% l('PIN Number or Password') %]</label>
+                    <div>[% INCLUDE "opac/parts/login/password_hint.tt2" %]</div>
+                </td>
+                <td  style="vertical-align: top; padding-top: 1.5em;">
+                    <div class="input_bg">
+                        <input id="password_field" name="password" type="password" />
+                    </div>
+                    <div>
+                        [%
+                            # 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" id="login_persist" /><label for="login_persist"> [% l('Stay logged in?') %]</label>
+                    </div>
+                    <div style="padding-top: 1em; margin-right: 1em;">
+                        <input type="submit" value="[% l('Log in') %]" alt="[% l('Log in') %]" class="opac-button" />
+                        [% IF reset_password %]
+                        <a href='[% mkurl(ctx.opac_root _ '/password_reset', {}, 1) %]'>[% l('Forgot your password?') %]</a>
+                        [% END %]
+                    </div>
+                </td>
+            </tr>
+        </table>
+    </form>
+</div>
+<div style='float:right; max-width: 200px; text-align: center; margin-right: 25%;'>[% INCLUDE "opac/parts/login/help.tt2" %]</div>