Tweak login form for Boreal feature/tpac_boreal_2_7
authorDan Scott <dscott@laurentian.ca>
Thu, 19 Nov 2015 19:01:10 +0000 (14:01 -0500)
committerDan Scott <dscott@laurentian.ca>
Thu, 19 Nov 2015 19:01:10 +0000 (14:01 -0500)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates_boreal/opac/parts/login/form.tt2 [new file with mode: 0644]

diff --git a/Open-ILS/src/templates_boreal/opac/parts/login/form.tt2 b/Open-ILS/src/templates_boreal/opac/parts/login/form.tt2
new file mode 100644 (file)
index 0000000..8c1cddd
--- /dev/null
@@ -0,0 +1,55 @@
+[% 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. " _
+           "Passwords are case-sensitive.  Check your Caps-Lock key 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'>
+        <div style="float: left; padding-bottom: 10px; margin-right: 40px;">
+            <label for='username_field' class="lbl1" >[% l("Numéro d'identité du Collège Boréal") %]</label>
+            <div class="input_bg">
+                <input type='text' id="username_field" name="username" autofocus />
+            </div>
+        </div>
+        <div style="float: left;">
+            <label for="password_field" class="lbl1" >[% l('PIN Number or Password') %]</label>
+            <div class="input_bg">
+                <input id="password_field" name="password" type="password" />
+            </div>
+            [% IF reset_password %]
+            <a style="font-size: 80%" href='[% mkurl(ctx.opac_root _ '/password_reset', {}, 1) %]'>[% l('Forgot your password?') %]</a>
+            [% END %]
+        </div>
+        <div style="clear: both; padding-top: 15px;">
+        [%
+            redirect = CGI.param('redirect_to');
+            # Don't use referer unless we got here from elsewhere within the TPAC
+            IF !redirect AND ctx.referer.match('^https?://' _ ctx.hostname _ ctx.opac_root);
+                redirect = ctx.referer;
+            END;
+            # If no redirect is offered or it's leading us back to the
+            # login form, redirect the user to My Account
+            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>
+            <input type="submit" value="[% l('Log in') %]" alt="[% l('Log in') %]" class="opac-button" />
+        </div>
+    </form>
+</div>
+[% INCLUDE "opac/parts/login/help.tt2" %]