web staff : show no-items message on empty holds/items-out tables
authorBill Erickson <berick@esilibrary.com>
Mon, 16 Dec 2013 15:02:58 +0000 (10:02 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 16 Dec 2013 15:02:58 +0000 (10:02 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/patron/t_holds_actions.tt2
Open-ILS/src/templates/staff/circ/patron/t_holds_table.tt2
Open-ILS/src/templates/staff/circ/patron/t_items_out_actions.tt2
Open-ILS/src/templates/staff/circ/patron/t_items_out_table.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 5d43ea8..2bc4e50 100644 (file)
@@ -1,4 +1,4 @@
-<div class="btn-group text-left">
+<div class="btn-group text-left" ng-show="holds.count()">
 
   <!-- PAGING -->
 
index 9d7f667..04f6060 100644 (file)
@@ -23,7 +23,14 @@ holds.addColumnsForClass('ahr', 'hold');
 ">
 </div>
 
-<div class="row">
+
+<div class="row" ng-show="!loading && !holds.count()">
+  <div class="col-lg-10 col-lg-offset-1">
+    <div class="alert alert-info">[% l('No Holds To Display') %]</div>
+  </div>
+</div>
+
+<div class="row" ng-show="holds.count()">
   <div class="col-lg-12">
     <table class="list table table-hover table-condensed">
       <thead>
index c43fd9a..c0876d1 100644 (file)
@@ -1,4 +1,4 @@
-<div class="btn-group text-left">
+<div class="btn-group text-left" ng-show="items_out.count()">
 
   <!-- PAGING -->
 
index 10b8be6..ca1df34 100644 (file)
@@ -22,7 +22,13 @@ items_out.setColumns([
 ">
 </div>
 
-<div class="row">
+<div class="row" ng-show="!loading && !items_out.count()">
+  <div class="col-lg-10 col-lg-offset-1">
+    <div class="alert alert-info">[% l('No Items To Display') %]</div>
+  </div>
+</div>
+
+<div class="row" ng-show="items_out.count()">
   <div class="col-lg-12">
     <table class="list table table-hover table-condensed">
       <thead>
index 006e25e..68bc9ea 100644 (file)
@@ -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();