From: Bill Erickson Date: Mon, 24 Mar 2014 15:27:03 +0000 (-0400) Subject: web staff autogrid X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1694f4399290a055a50a4c0f47d3ba5306b9b81e;p=working%2FEvergreen.git web staff autogrid Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 b/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 index 4091ab4d3a..0e575c2f18 100644 --- a/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 @@ -21,7 +21,6 @@ .eg-grid-header-row { font-weight: bold; - border-top: 1px solid #ccc; } .eg-grid-header-row > .eg-grid-cell { @@ -35,6 +34,9 @@ } /* in config display, make cells more obvious */ + .eg-grid-as-conf .eg-grid-row { + border: 1px solid #777; + } .eg-grid-as-conf .eg-grid-cell { border-right: 1px solid #777; } @@ -53,19 +55,22 @@ width:95%; text-align:center; } + .eg-grid-conf-cell-entry:not(:first-child) { border-top:1px solid #ccc; } - + .eg-grid-conf-row { + background-color: #dff0d8; + border-color: #d6e9c6; + } -
- - -
+ .eg-grid-conf-row:first-child { + /* alignment fix; account for one missing border */ + padding-right: 1px; + } + +
@@ -84,7 +89,7 @@
@@ -92,7 +97,7 @@ -
+
[% l('Wider') %]
[% l('Narrower') %]
@@ -100,17 +105,17 @@
+ ng-click="modifyColumnFlex(column,1)">
+ ng-click="modifyColumnFlex(column,-1)">
@@ -139,7 +144,7 @@
{{list.fieldValue(item, column.name) | egGridvalueFilter:column}}
diff --git a/Open-ILS/src/templates/staff/test/t_autogrid.tt2 b/Open-ILS/src/templates/staff/test/t_autogrid.tt2 index 1a8aa84675..a7546e3592 100644 --- a/Open-ILS/src/templates/staff/test/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/test/t_autogrid.tt2 @@ -11,19 +11,19 @@ eg-grid-field's require closing tags; not sure why you can also do
--> - - + + - + - + - + diff --git a/Open-ILS/web/js/ui/default/staff/services/autogrid.js b/Open-ILS/web/js/ui/default/staff/services/autogrid.js index 36d4b97d5b..e7f74bd1c5 100644 --- a/Open-ILS/web/js/ui/default/staff/services/autogrid.js +++ b/Open-ILS/web/js/ui/default/staff/services/autogrid.js @@ -97,6 +97,13 @@ angular.module('egGridMod', ['egCoreMod', 'egListMod', 'egUiMod', 'ui.bootstrap' }); }, + $scope.modifyColumnFlex = function(column, val) { + column.flex += val; + // prevent flex:0; use hiding instead + if (column.flex < 1) + column.flex = 1; + } + $scope.toggleGridConf = function() { if ($scope.showGridConf) { $scope.showGridConf = false; @@ -120,13 +127,13 @@ angular.module('egGridMod', ['egCoreMod', 'egListMod', 'egUiMod', 'ui.bootstrap' name : fieldSpec.name, label : fieldSpec.label, path : fieldSpec.path, + flex : fieldSpec.flex, datatype : fieldSpec.datatype, display : (fieldSpec.display !== false) }; if (!field.path) field.path = field.name; field = self.absorbField(field); $scope.list.addColumn(field); - field.flexWidth = 2; // TODO: } /** @@ -215,6 +222,7 @@ angular.module('egGridMod', ['egCoreMod', 'egListMod', 'egUiMod', 'ui.bootstrap' name : field.name, label : field.label, path : field.path || field.name, + flex : field.flex || 2, display : (field.display === false) ? false : true }; @@ -318,7 +326,7 @@ angular.module('egGridMod', ['egCoreMod', 'egListMod', 'egUiMod', 'ui.bootstrap' require : '^egGrid', restrict : 'AE', transclude : true, - scope : {name : '@', path : '@', label : '@'}, + scope : {name : '@', path : '@', label : '@', flex : '@'}, template : '
', // NOOP template link : function(scope, element, attrs, egGridCtrl) { egGridCtrl.addColumn(scope);