disable Manage button in Alerts column when there are no alerts
authorGalen Charlton <gmc@esilibrary.com>
Tue, 25 Oct 2016 14:50:32 +0000 (10:50 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 27 Mar 2017 20:35:43 +0000 (16:35 -0400)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2

index 52d36da..8183cce 100644 (file)
     <eg-grid-field label="[% l('Reference') %]"              datatype="bool" path="ref"></eg-grid-field>
     <eg-grid-field label="[% l('Alerts') %]" path="copy_alert_count" handlers="gridCellHandlers" visible compiled>
       {{item['copy_alert_count']}}
-      <button class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
+      <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
     </eg-grid-field>
   
   </eg-grid>
index 1f0bba0..b4bced4 100644 (file)
@@ -75,7 +75,7 @@
 
   <eg-grid-field label="[% l('Alerts') %]" path="copy_alert_count" handlers="gridCellHandlers" visible compiled>
     {{item['copy_alert_count']}}
-    <button class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
+    <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
   </eg-grid-field>
   
 </eg-grid>
index 189aa5c..9819330 100644 (file)
 
   <eg-grid-field label="[% l('Alerts') %]" path="copy_alert_count" handlers="gridCellHandlers" visible compiled>
     {{item['copy_alert_count']}}
-    <button class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['acp'].id())">[% l('Manage') %]</button>
+    <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['acp'].id())">[% l('Manage') %]</button>
   </eg-grid-field>
 
   <eg-grid-field path="circ.*" parent-idl-class="circ" hidden></eg-grid-field>