more workstation config UI bits
authorBill Erickson <berick@esilibrary.com>
Tue, 29 Apr 2014 21:46:05 +0000 (17:46 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 29 Apr 2014 21:46:05 +0000 (17:46 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js

index 1fd7591..e5e4602 100644 (file)
@@ -1,7 +1,38 @@
 <br/>
-<div class="container">
+<style>
+  #admin-workstation-container .new-entry {
+    margin-top: 10px;
+    padding-top: 10px;
+    border-top: 1px solid #F5F5F5;
+  }
+</style>
+
+<div class="container" id="admin-workstation-container">
+
+  <div class="row">
+    <div class="col-md-6">
+      <div class="checkbox">
+        <label>
+          <input type="checkbox" ng-class="{disabled : !userHasAdminPerm}"
+            ng-model="usesWorkstation" ng-change="updateHatchRequired()">
+[% l('This workstation requires a workstation name?') %]
+        </label>
+      </div>
+    </div>
+  </div>
   <div class="row">
     <div class="col-md-6">
+      <input type='text' class='form-control'  
+        ng-disabled="!userHasAdminPerm || !usesWorkstation"
+        title="[% l('Workstation Name') %]"
+        placeholder="[% l('Workstation Name') %]"
+        ng-change='updateWorkstation()' ng-model='workstationName'/>
+    </div>
+  </div>
+
+
+  <div class="row new-entry">
+    <div class="col-md-6">
       <div class="checkbox">
         <label>
           <input type="checkbox" ng-class="{disabled : !userHasAdminPerm}"
     </div>
   </div>
 
-  <br/><br/>
-  <div class="row" id="splash-nav">
-
-    <div class="col-md-4">
-      <div class="panel panel-success">
-        <div class="panel-heading">
-          <div class="panel-title text-center">
-            [% l('Printing, Templates, etc.') %]
-          </div>
-        </div>
-        <div class="panel-body">
-          <div>
-            <span class="glyphicon glyphicon-print"></span>
-            <a target="_self" href="./admin/workstation/printing">
-              [% l('Printer Settings') %]
-            </a>
-          </div>
-        </div>
-      </div>
-    </div>
-
-    <div class="col-md-4">
-      <div class="panel panel-success">
-        <div class="panel-heading">
-          <div class="panel-title text-center">
-            [% l('Other') %]
-          </div>
-        </div>
-        <div class="panel-body">
-          <div>
-          </div>
-        </div>
-      </div>
+  <div class="row new-entry">
+    <div class="col-md-6">
+      <span class="glyphicon glyphicon-print"></span>
+      <a target="_self" href="./admin/workstation/printing">
+        [% l('Printer Settings') %]
+      </a>
     </div>
+  </div>
 
-    <div class="col-md-4">
-      <div class="panel panel-success">
-        <div class="panel-heading">
-          <div class="panel-title text-center">
-            [% l('Other') %]
-          </div>
-        </div>
-        <div class="panel-body">
-          <div>
-            <span class="glyphicon glyphicon-info-sign"></span>
-            <a target="_self" href="./admin/workstation/stored_prefs">
-              [% l('Stored Preferences') %]
-            </a>
-          </div>
-        </div>
-      </div>
+  <div class="row new-entry">
+    <div class="col-md-6">
+      <span class="glyphicon glyphicon-info-sign"></span>
+      <a target="_self" href="./admin/workstation/stored_prefs">
+        [% l('Stored Preferences') %]
+      </a>
     </div>
-
   </div>
+
 </div>
index e786506..9ecad91 100644 (file)
@@ -36,12 +36,20 @@ angular.module('egWorkstationAdmin',
 }])
 
 .controller('SplashCtrl',
-       ['$scope','egPrintStore','egUser',
-function($scope , egPrintStore , egUser) {
+       ['$scope','egPrintStore','egUser','egEnv','egAuth',
+function($scope , egPrintStore , egUser , egEnv , egAuth) {
 
     $scope.userHasAdminPerm = false;
     egUser.hasPermHere('ADMIN_WORKSTATION')
     .then(function(bool) { $scope.userHasAdminPerm = bool });
+
+    var workstation;
+    if (egEnv.aws) { // TODO: move this to egAuth
+        workstation = egEnv.aws.map[egAuth.user().wsid()];
+
+        // strip the org unit component of the name
+        $scope.workstationName = workstation.name().split(/-/)[1]; 
+    }
     
     $scope.hatchURL = egPrintStore.hatchURL();
     $scope.hatchRequired = 
@@ -56,6 +64,21 @@ function($scope , egPrintStore , egUser) {
         egPrintStore.setLocalItem(
             'eg.conf.hatch.url', $scope.hatchURL);
     }
+
+    $scope.updateUsesWorkstation = function() {
+        egPrintStore.setLocalItem(
+            'eg.conf.workstation.required', $scope.usesWorkstation);
+    }
+
+    $scope.updateUsesWorkstation = function() {
+        // TODO
+        /*
+        egPrintStore.setLocalItem(
+            'eg.conf.workstation.name', $scope.workstationName);
+        */
+    }
+
+
 }])
 
 .controller('PrintingCtrl',