From 14c0ff6531bd9b1ff90efdf2367c9f356519dfde Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 16 Dec 2013 10:02:58 -0500 Subject: [PATCH] web staff : show no-items message on empty holds/items-out tables Signed-off-by: Bill Erickson --- .../src/templates/staff/circ/patron/t_holds_actions.tt2 | 2 +- .../src/templates/staff/circ/patron/t_holds_table.tt2 | 9 ++++++++- .../templates/staff/circ/patron/t_items_out_actions.tt2 | 2 +- .../templates/staff/circ/patron/t_items_out_table.tt2 | 8 +++++++- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 17 ++++++++++++++++- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_holds_actions.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_holds_actions.tt2 index 5d43ea879a..2bc4e501d8 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_holds_actions.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_holds_actions.tt2 @@ -1,4 +1,4 @@ -
+
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_holds_table.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_holds_table.tt2 index 9d7f667005..04f6060f26 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_holds_table.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_holds_table.tt2 @@ -23,7 +23,14 @@ holds.addColumnsForClass('ahr', 'hold'); ">
-
+ +
+
+
[% l('No Holds To Display') %]
+
+
+ +
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out_actions.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out_actions.tt2 index c43fd9a96e..c0876d1731 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out_actions.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out_actions.tt2 @@ -1,4 +1,4 @@ -
+
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 10b8be6f02..ca1df34bd6 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 @@ -22,7 +22,13 @@ items_out.setColumns([ ">
-
+
+
+
[% l('No Items To Display') %]
+
+
+ +
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 006e25e3f5..68bc9ea45b 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 @@ -639,7 +639,7 @@ function($scope, $q, $modal, $routeParams, egNet, egAuth, egUser, $scope.focusMe = true; $scope.precatArgs = { copy_barcode : copy_barcode, - circ_modifier : circMods.length ? circMods[0].code() : '' + circ_modifier : circMods.length ? circMods[0].code() : null }; $scope.circModifiers = circMods; $scope.ok = function(args) { $modalInstance.close(args) } @@ -723,6 +723,7 @@ function($scope, $q, $routeParams, egNet, egAuth, egUser, patronSvc, egPC function fetchItemsOut() { var newlist = []; + $scope.loading = true; egNet.request('open-ils.actor', 'open-ils.actor.user.checked_out.authoritative', egAuth.token(), $scope.patron_id) @@ -736,6 +737,11 @@ function($scope, $q, $routeParams, egNet, egAuth, egUser, patronSvc, egPC .concat(outs.lost) .concat(outs.claims_returned) + if (!newlist.length) { + $scope.loading = false; + return; + } + // TODO: Websockets means 1 streaming request instead of // multiple singles. As is, one response may be too large // to wait on. @@ -754,6 +760,7 @@ function($scope, $q, $routeParams, egNet, egAuth, egUser, patronSvc, egPC // note that fleshed fields are explicitly selected. select : { bre : ['id'] } }).then(function(circ) { + $scope.loading = false; // local fleshing circ.circ_lib(egOrg.get(circ.circ_lib())); @@ -801,6 +808,7 @@ function($scope, $q, $routeParams, egNet, egAuth, egUser, patronSvc, egOr } function fetchPatronHolds() { + $scope.loading = true; egNet.request( 'open-ils.circ', @@ -808,6 +816,12 @@ function($scope, $q, $routeParams, egNet, egAuth, egUser, patronSvc, egOr egAuth.token(), $scope.patron_id ).then(function(hold_ids) { + + if (!hold_ids.length) { + $scope.loading = false; + return; + } + angular.forEach(hold_ids, function(id) { egNet.request( @@ -816,6 +830,7 @@ function($scope, $q, $routeParams, egNet, egAuth, egUser, patronSvc, egOr egAuth.token(), id ).then(function(hold_data) { + $scope.loading = false; var hold = hold_data.hold; hold_data.id = hold.id(); -- 2.11.0