From ffdc2df1844bdf5bf3528bd7b31b32a956042fe0 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 24 Mar 2014 17:25:28 -0400 Subject: [PATCH] web staff autogrid; porting items out experiment Signed-off-by: Bill Erickson --- Open-ILS/src/templates/staff/circ/patron/index.tt2 | 1 + .../staff/circ/patron/t_items_out_table.tt2 | 98 +++++++++------------- Open-ILS/src/templates/staff/parts/t_autogrid.tt2 | 11 ++- Open-ILS/src/templates/staff/test/index.tt2 | 2 +- .../web/js/ui/default/staff/circ/patron/app.js | 2 +- .../staff/services/{autogrid.js => grid.js} | 1 + Open-ILS/web/js/ui/default/staff/services/list.js | 1 + 7 files changed, 52 insertions(+), 64 deletions(-) rename Open-ILS/web/js/ui/default/staff/services/{autogrid.js => grid.js} (99%) diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2 index 076ba8e607..e94c3bb06a 100644 --- a/Open-ILS/src/templates/staff/circ/patron/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2 @@ -7,6 +7,7 @@ [% BLOCK APP_JS %] + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out_table.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out_table.tt2 index a62d91b54f..65721dc8ff 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out_table.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out_table.tt2 @@ -1,61 +1,43 @@ -[% -COLUMNS = [ -{label => l('Circ ID'), name => 'id', display => 1}, -{label => l('Barcode'), name => 'target_copy.barcode' display => 1}, -{label => l('Due Date'), name => 'due_date' display => 1}, -{label => l('Checkout/Renewal Library'), - name => 'circ_lib.shortname' display => 1}, -{label => l('Renewals Remaining'), name => 'renewal_remaining' display => 1}, -{label => l('Fines Stopped'), name => 'stop_fines' display => 1}, -{label => l('Title'), - name => 'target_copy.call_number.record.simple_record.title', display => 1}, -] -%] - -
-
+ + + + + + + + + + + + + -
-
-
[% l('No Items To Display') %]
-
-
+ + + -
-
- - - - - - - - - - - - - - -
# - {{col.label}} -
{{$index + 1}} - - {{items_out.fieldValue(circ, col.name)}} -
-
-
diff --git a/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 b/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 index 311236aa2a..9f525f0e73 100644 --- a/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/parts/t_autogrid.tt2 @@ -1,7 +1,7 @@
@@ -38,9 +38,12 @@
+
[% l('No Items To Display') %]
+ -
+
@@ -114,7 +117,7 @@ ng-repeat="column in list.allColumns" style="flex:{{column.flex}}" ng-show="list.displayColumns[column.name]"> - {{list.fieldValue(item, column.name) | egGridvalueFilter:column}} + {{list.fieldValue(item, column.path) | egGridvalueFilter:column}}
diff --git a/Open-ILS/src/templates/staff/test/index.tt2 b/Open-ILS/src/templates/staff/test/index.tt2 index 68d48020a8..0f360bdb1c 100644 --- a/Open-ILS/src/templates/staff/test/index.tt2 +++ b/Open-ILS/src/templates/staff/test/index.tt2 @@ -8,7 +8,7 @@ [% BLOCK APP_JS %] - + [% END %] diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index 0d8c02bc53..ad9c96ad79 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -8,7 +8,7 @@ */ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap', - 'egCoreMod', 'egUiMod', 'egListMod', 'egUserMod']) + 'egCoreMod', 'egUiMod', 'egListMod', 'egGridMod', 'egUserMod']) .config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); diff --git a/Open-ILS/web/js/ui/default/staff/services/autogrid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js similarity index 99% rename from Open-ILS/web/js/ui/default/staff/services/autogrid.js rename to Open-ILS/web/js/ui/default/staff/services/grid.js index e6e478497f..90545c08da 100644 --- a/Open-ILS/web/js/ui/default/staff/services/autogrid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -135,6 +135,7 @@ angular.module('egGridMod', ['egCoreMod', 'egListMod', 'egUiMod', 'ui.bootstrap' display : (fieldSpec.display !== false) }; if (!field.path) field.path = field.name; + if (!field.name) field.name = field.path; field = self.absorbField(field); $scope.list.addColumn(field); } diff --git a/Open-ILS/web/js/ui/default/staff/services/list.js b/Open-ILS/web/js/ui/default/staff/services/list.js index 763a8adda6..32bee97fae 100644 --- a/Open-ILS/web/js/ui/default/staff/services/list.js +++ b/Open-ILS/web/js/ui/default/staff/services/list.js @@ -51,6 +51,7 @@ angular.module('egListMod', ['egCoreMod']) this.selected = {}; this.indexValue = function(item) { + if (!item) return null; if (this.indexFieldAsFunction) { return item[this.indexField](); } else { -- 2.11.0