</div>
<!-- penalties -->
- <div class="row" ng-if="patron().standing_penalties().length">
+ <div class="row" ng-if="alert_penalties.length">
<div class="col-md-12">
<div class="panel panel-warning">
<div class="panel-heading">
</div>
<div class="panel-body">
<div class="row"
- ng-repeat="penalty in patron().standing_penalties()">
+ ng-repeat="penalty in alert_penalties">
<div class="col-md-2">
{{penalty.org_unit().shortname()}}
</div>
<div ng-show="patron()" id="patron-summary-grid">
<div class="row"
ng-class="{'patron-summary-divider' : !$index}"
- ng-repeat="penalty in patron().standing_penalties()">
+ ng-repeat="penalty in alert_penalties">
<div
- ng-if="penalty.standing_penalty().block_list()"
class="col-md-9 patron-summary-alert"
title="{{penalty.standing_penalty().name()}}">
{{penalty.note() || penalty.standing_penalty().label()}}
</div>
- <div class="col-md-3"
- ng-if="penalty.standing_penalty().block_list()">
+ <div class="col-md-3">
{{penalty.set_date() | date:'shortDate'}}
</div>
</div>
<div class="row"
- ng-class="{'patron-summary-divider' : patron().standing_penalties().length}">
+ ng-class="{'patron-summary-divider' : alert_penalties.length}">
<div class="col-md-5">[% l('Profile') %]</div>
<div class="col-md-7">{{patron().profile().name()}}</div>
</div>
var deferred = $q.defer();
var p = service.current;
- if (p.standing_penalties().length ||
+ service.alert_penalties = p.standing_penalties().filter(
+ function(pen) {
+ return pen.standing_penalty().staff_alert() == 't'
+ }
+ );
+
+ if (service.alert_penalties.length ||
p.alert_message() ||
p.active() == 'f' ||
p.barred() == 't' ||
function($scope, $q, $location , $filter, egCore, egUser, patronSvc) {
function redirectToAlertPanel() {
+
+ $scope.alert_penalties = patronSvc.alert_penalties;
+
if (patronSvc.alertsShown) return;
patronSvc.alertsShown = true;