mirror of
https://github.com/sismics/docs.git
synced 2025-12-14 02:06:25 +00:00
+ metadata-complete="true" in web.xml to skip annotations scanning (second try with Jetty 9)
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Share controller.
|
|
*/
|
|
angular.module('share').controller('Share', function($scope, $state, $stateParams, Restangular) {
|
|
// Load document
|
|
Restangular.one('document', $stateParams.documentId).get({ share: $stateParams.shareId })
|
|
.then(function (data) {
|
|
$scope.document = data;
|
|
}, function (response) {
|
|
if (response.status == 403) {
|
|
$state.go('403');
|
|
}
|
|
});
|
|
|
|
// Load files
|
|
Restangular.one('file').getList('list', { id: $stateParams.documentId, share: $stateParams.shareId })
|
|
.then(function (data) {
|
|
$scope.files = data.files;
|
|
});
|
|
|
|
// Load comments from server
|
|
Restangular.one('comment', $stateParams.documentId).get({ share: $stateParams.shareId }).then(function(data) {
|
|
$scope.comments = data.comments;
|
|
}, function(response) {
|
|
$scope.commentsError = response;
|
|
});
|
|
|
|
/**
|
|
* Navigate to the selected file.
|
|
*/
|
|
$scope.openFile = function (file) {
|
|
$state.go('share.file', { documentId: $stateParams.documentId, shareId: $stateParams.shareId, fileId: file.id })
|
|
};
|
|
}); |