web staff autogrid; conf stuff
authorBill Erickson <berick@esilibrary.com>
Sun, 23 Mar 2014 22:29:01 +0000 (18:29 -0400)
committerBill Erickson <berick@esilibrary.com>
Sun, 23 Mar 2014 22:29:01 +0000 (18:29 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/parts/t_autogrid.tt2
Open-ILS/web/js/ui/default/staff/services/autogrid.js
Open-ILS/web/js/ui/default/staff/services/list.js

index 2b9a72b..e49d539 100644 (file)
@@ -1,30 +1,40 @@
 <style>
   /* TODO: move me */
-  .eg-grid > div:nth-child(odd) {background-color: rgb(248, 248, 248);}
+  /*.eg-grid > div:nth-child(odd) {background-color: rgb(248, 248, 248);}*/
+  .eg-grid-row:hover > .eg-grid-cell {background-color: rgb(248, 248, 248)}
   .eg-grid-scroll {overflow-y:scroll; height: 600px}
 
-  .eg-grid-header-row { font-weight: bold; }
+  .eg-grid-header-row { 
+    font-weight: bold; 
+  }
   .eg-grid-row {
     display: flex;
     width: 100%;
+    border-left: 1px solid #ccc;
+  }
+
+  .eg-grid-header-row > .eg-grid-cell {
+    border-top: 1px solid #ccc;
   }
+
   .eg-grid-action-row {
     display:flex;
     justify-content:flex-end;
     width:100%;
   }
   .eg-grid-cell {
-    border: 1px solid #ccc;
+    border-bottom: 1px solid #ccc;
+    border-right: 1px solid #DDD;
     padding: 2px;
     overflow: hidden;
   }
   .eg-grid-cell-1 {
     flex: 1;
   }
-  .eg-grid-row-selected { 
+  .eg-grid-row-selected > .eg-grid-cell 
     color: rgb(51, 51, 51);
-    background-color: rgb(86,61,124,15);
-    border: 1px solid rgb(86,61,124,2);
+    background-color: rgb(248, 248, 248);
+    border-bottom: 1px solid #888;
   }
 </style>
 
       ng-repeat="column in dataList.allColumns"
       style="flex:{{column.flexWidth}}"
       ng-show="dataList.displayColumns[column.name]">
-      <div style="display:flex;background-color:#EEE;padding:5px;border-bottom:2px solid #ccc">
-        <div style="flex:1">
-          <a href="javascript:;" 
-            ng-click="column.flexWidth = column.flexWidth - 1">
-            <span class="glyphicon glyphicon-step-backward"></span>
-          </a>
-        </div>
-        <div style="flex:1">
-          <a href="javascript:;" 
-            ng-click="column.flexWidth = column.flexWidth + 1">
-            <span class="glyphicon glyphicon-step-forward"></span>
-          </a>
-        </div>
+      <div style="width:100%;text-align:center">
+        <a href="javascript:;" title="[% l('Make column wider') %]"
+          ng-click="column.flexWidth = column.flexWidth + 1">
+          <span class="glyphicon glyphicon-fast-forward"></span>
+        </a>
+      </div>
+      <div style="width:100%;text-align:center;border-top:1px solid #ccc">
+        <a href="javascript:;" title="[% l('Make column narrower') %]"
+          ng-click="column.flexWidth = column.flexWidth - 1">
+          <span class="glyphicon glyphicon-fast-backward"></span>
+        </a>
+      </div>
+      <div style="width:100%;text-align:center;border-top:1px solid #ccc">
+        <input type='number' ng-model="column.sortPriority" 
+          title="[% l('Sort Priority') %]" style='width:3em'/>
       </div>
     </div>
   </div>
index 356ac79..3796a7c 100644 (file)
@@ -267,26 +267,6 @@ angular.module('egGridMod', ['egCoreMod', 'egListMod', 'egUiMod', 'ui.bootstrap'
                     $scope.dataList.indexValue(item)
                 ];
             }
-
-            /*
-            $scope.openGridConfDialog = function() {
-                $modal.open({
-                    templateUrl: '/eg/staff/parts/t_autogrid_conf', // TODO: avoid abs url
-                    controller: [
-                        '$scope', '$modalInstance', 'dataList',
-                        function($scope, $modalInstance, dataList) {
-                        $scope.dataList = dataList;
-                        $scope.ok = function() {$modalInstance.close()}
-                        $scope.cancel = function() {$modalInstance.close()}
-                    }],
-                    resolve : {
-                        dataList : function() {
-                            return $scope.dataList;
-                        }
-                    }
-                }).result.then(function() {});
-            }
-            */
         }
     };
 })
index f9c547d..4e7d6c1 100644 (file)
@@ -158,6 +158,8 @@ angular.module('egListMod', ['egCoreMod'])
             this.allColumns.push(col);
             if (col.display) 
                 this.displayColumns[col.name] = true;
+            if (!col.sortPriority)
+                col.sortPriority = 0;
         }
 
         this.defaultColumns = function(list) {