dashboard: finish checklist display

pending showing acknowledged items later
This commit is contained in:
Johannes Zellner
2024-04-19 14:32:31 +02:00
parent 4516b0c57c
commit d35bfbb0fd
2 changed files with 4 additions and 6 deletions
+2 -2
View File
@@ -772,14 +772,14 @@
<br/>
<div ng-repeat="item in info.checklist">
<div ng-repeat="item in app.checklist">
<div class="checklist-item" ng-hide="item.acknowledged">
{{ item.message }}
<button class="btn btn-sm btn-default btn-outline" ng-click="info.checklistAck(item)"><i class="fas fa-check"></i></button>
</div>
</div>
<div ng-repeat="item in info.checklist" ng-show="info.showDoneChecklist">
<div ng-repeat="item in app.checklist" ng-show="info.showDoneChecklist">
<div class="checklist-item checklist-item-acknowledged" ng-show="item.acknowledged">
{{ item.message }}
<button class="btn btn-sm btn-default btn-outline" ng-click="info.checklistAck(item)"><i class="fas fa-check"></i></button>
+2 -4
View File
@@ -137,7 +137,6 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
};
$scope.info = {
checklist: [],
showDoneChecklist: false,
notes: {
@@ -174,16 +173,15 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
},
show: function () {
$scope.info.checklist = $scope.app.checklist;
$scope.info.notes.content = $scope.app.notes;
$scope.info.notes.editing = false;
$scope.info.notes.busy = false;
},
checklistAck(item) {
item.acknowledged = !item.acknowledged;
item.acknowledged = true;
Client.configureApp($scope.app.id, 'checklist', { checklist: $scope.info.checklist }, function (error) {
Client.configureApp($scope.app.id, 'checklist', { checklist: $scope.app.checklist }, function (error) {
if (error) return console.error('Failed to save checklist.', error);
});
}