<a href ng-click="detail_tab = 'notes'">[% l('Notes') %]</a>
</li>
<li ng-class="{active : detail_tab == 'notify'}">
- <a href ng-click="detail_tab = 'notify'">
- [% l('Manual Notifications') %]
+ <a href ng-click="show_notify_tab()">
+ [% l('Staff Notifications') %]
</a>
</li>
</ul>
</div>
</div><!-- notes tab content -->
+ <div ng-if="detail_tab == 'notify'">
+
+ <button class="btn btn-default" ng-click="new_notification()">
+ [% l('Add Record of Notification') %]
+ </button>
+
+ <div class="row pad-vert"
+ ng-repeat="notify in hold.notifications()">
+ <div class="col-md-12">
+ <div class="row">
+ <div class="col-md-6 strong-text">{{notify.method()}}</div>
+ <div class="col-md-6">
+ <div class="pull-right">
+ <span class="pad-horiz">{{notify.notify_time() | date:'short'}}</span>
+ <span>[% l('Created by [_1]', '{{notify.notify_staff().usrname()}}') %]</span>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <!-- hmm, not sure why the margin-left is needed.. the well? -->
+ <div class="col-md-12 well" style="margin-left:12px">
+ <div class="row">
+ <div class="col-md-8">
+ <div class="">{{notify.note()}}</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div><!-- notes tab content -->
+
</div><!-- tab pane -->
</div><!-- tab-content -->
});
}
+ $scope.show_notify_tab = function() {
+ $scope.detail_tab = 'notify';
+ egCore.pcrud.search('ahn',
+ {hold : $scope.hold.id()},
+ {flesh : 1, flesh_fields : {ahn : ['notify_staff']}},
+ {atomic : true}
+ ).then(function(nots) {
+ $scope.hold.notifications(nots);
+ });
+ }
+
$scope.delete_note = function(note) {
egCore.pcrud.remove(note).then(function() {
// remove the deleted note from the locally fleshed notes