[open-ils-commits] r11168 - in trunk/Open-ILS/web: js/ui templates

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 13 14:59:27 EST 2008


Author: erickson
Date: 2008-11-13 14:59:23 -0500 (Thu, 13 Nov 2008)
New Revision: 11168

Added:
   trunk/Open-ILS/web/templates/login.tt2
Modified:
   trunk/Open-ILS/web/js/ui/base.js
   trunk/Open-ILS/web/templates/base.tt2
Log:
slight cleanup and re-org

Modified: trunk/Open-ILS/web/js/ui/base.js
===================================================================
--- trunk/Open-ILS/web/js/ui/base.js	2008-11-13 19:49:18 UTC (rev 11167)
+++ trunk/Open-ILS/web/js/ui/base.js	2008-11-13 19:59:23 UTC (rev 11168)
@@ -1,22 +1,28 @@
 dojo.require('dijit.Dialog');
+dojo.require('dojo.cookie');
 dojo.require('fieldmapper.dojoData');
 dojo.require('openils.User');
-dojo.require('dojo.cookie');
 dojo.require('openils.CGI');
 dojo.require('openils.Event');
+dojo.require('openils.Util');
 
 function oilsSetupUser() {
     var authtoken = new openils.CGI().param('ses') || dojo.cookie('ses');
+    var workstation = dojo.cookie('oils.ws');
     var user;
     if(authtoken) user = new openils.User({authtoken:authtoken});
     if(!authtoken || openils.Event.parse(user.user)) {
-        dojo.cookie('ses', openils.User.authtoken, {expires:-1, path:'/'});
+        dojo.cookie('ses', openils.User.authtoken, {expires:-1, path:'/'}); // remove the cookie
         openils.User.authtoken = null;
-        dojo.addOnLoad(function(){oilsLoginDialog.show();});
+        dojo.addOnLoad(function(){
+            oilsLoginDialog.show();
+            dojo.byId('oils-login-workstation').innerHTML = workstation || '';
+        });
         return;
     }
     dojo.cookie('ses', authtoken, {path : oilsCookieBase});
     openils.User.authtoken = authtoken;
+    openils.User.workstation = dojo.cookie('oils.ws');
 }
 
 function oilsDoLogin() {
@@ -27,7 +33,8 @@
         type: 'staff' // hardcode for now
     });
     dojo.cookie('ses', user.authtoken, {path : oilsCookieBase});
-    return true;
+    location.href = location.href;
+    return false;
 }
 
 oilsSetupUser();

Modified: trunk/Open-ILS/web/templates/base.tt2
===================================================================
--- trunk/Open-ILS/web/templates/base.tt2	2008-11-13 19:49:18 UTC (rev 11167)
+++ trunk/Open-ILS/web/templates/base.tt2	2008-11-13 19:59:23 UTC (rev 11168)
@@ -14,28 +14,7 @@
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/base.js"></script>
     </head>
     <body class='tundra'>
-
-        <!-- general purpose login dialog -->
-        <div style='display:none;' dojoType="dijit.Dialog" jsId='oilsLoginDialog' class='oils-login-dialog'>
-            <b>Please Login</b>
-            <form onsubmit='oilsDoLogin();'>
-            <table>
-                <tr>
-                    <td>Username</td>
-                    <td><input type='dijit.form.TextBox' id='oils-login-username'/></td>
-                </tr>
-                <tr>
-                    <td>Password</td>
-                    <td><input type='dijit.form.TextBox' id='oils-login-password' type='password'/></td>
-                </tr>
-                <tr>
-                    <td colspan='2'>
-                        <button type='submit' dojoType='dijit.form.Button'>Login</button>
-                    </td>
-                </tr>
-            </table>
-            </form>
-        </div>
-        [% content %]
+        [% INCLUDE login.tt2 %] <!-- shared login page -->
+        [% content %] <!-- Page body -->
     </body>
 </html>

Added: trunk/Open-ILS/web/templates/login.tt2
===================================================================
--- trunk/Open-ILS/web/templates/login.tt2	                        (rev 0)
+++ trunk/Open-ILS/web/templates/login.tt2	2008-11-13 19:59:23 UTC (rev 11168)
@@ -0,0 +1,25 @@
+<!-- general purpose login dialog -->
+<div style='display:none;' dojoType="dijit.Dialog" jsId='oilsLoginDialog' class='oils-login-dialog'>
+    <b>Please Login</b>
+    <form>
+        <table>
+            <tr>
+                <td>Username</td>
+                <td><input type='dijit.form.TextBox' id='oils-login-username'/></td>
+            </tr>
+            <tr>
+                <td>Password</td>
+                <td><input type='dijit.form.TextBox' id='oils-login-password' type='password'/></td>
+            </tr>
+            <tr>
+                <td>Workstation</td>
+                <td><span id='oils-login-workstation'/></td>
+            </tr>
+            <tr>
+                <td colspan='2' align='center'>
+                    <button onclick='oilsDoLogin();' dojoType='dijit.form.Button'>Login</button>
+                </td>
+            </tr>
+        </table>
+    </form>
+</div>



More information about the open-ils-commits mailing list