Add per-app notes feature

This commit is contained in:
Johannes Zellner
2024-04-10 17:02:32 +02:00
parent 0fa1ec44b1
commit 87ae95aa4f
8 changed files with 158 additions and 5 deletions

View File

@@ -136,6 +136,43 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
};
$scope.info = {
notes: {
busy: false,
editing: false,
content: '',
edit: function () {
$scope.info.notes.busy = false;
$scope.info.notes.content = $scope.app.notes;
$scope.info.notes.editing = true;
},
dismiss: function () {
$scope.info.notes.busy = false;
$scope.info.notes.content = $scope.app.notes;
$scope.info.notes.editing = false;
},
submit: function () {
$scope.info.notes.busy = true;
Client.configureApp($scope.app.id, 'notes', { notes: $scope.info.notes.content }, function (error) {
if (error) return console.error('Failed to save notes.', error);
$scope.info.notes.busy = false;
$scope.info.notes.editing = false;
});
}
},
show: function () {
$scope.info.notes.busy = false;
$scope.info.notes.content = $scope.app.notes;
$scope.info.notes.editing = false;
}
};
$scope.display = {
busy: false,
error: {},