1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-21 05:31:42 +00:00

Server side tag system

This commit is contained in:
jendib
2013-07-29 22:55:32 +02:00
parent 74132103bb
commit 62b6512996
14 changed files with 808 additions and 6 deletions

View File

@@ -37,6 +37,26 @@ App.controller('DocumentView', function($rootScope, $scope, $state, $stateParams
$state.transitionTo('document.view.file', { id: $stateParams.id, fileId: file.id })
};
/**
* Delete a document.
*/
$scope.deleteDocument = function(document) {
var title = 'Delete document';
var msg = 'Do you really want to delete this document?';
var btns = [{result:'cancel', label: 'Cancel'}, {result:'ok', label: 'OK', cssClass: 'btn-primary'}];
$dialog.messageBox(title, msg, btns)
.open()
.then(function(result) {
if (result == 'ok') {
Restangular.one('document', document.id).remove().then(function() {
$scope.loadDocuments();
$state.transitionTo('document.default');
});
}
});
};
/**
* Delete a file.
*/

View File

@@ -1,5 +1,6 @@
<div class="text-right">
<div class="btn-group">
<button class="btn btn-danger" ng-click="deleteDocument(document)"><span class="icon-trash icon-white"></span> Delete</button>
<button class="btn btn-primary" ng-click="editDocument(document.id)"><span class="icon-pencil icon-white"></span> Edit</button>
</div>
</div>