1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-15 18:56:18 +00:00

Init share app, client refactoring

This commit is contained in:
jendib
2013-08-15 00:43:06 +02:00
parent ecb2afd628
commit ed85909d00
53 changed files with 377 additions and 133 deletions

View File

@@ -0,0 +1,22 @@
'use strict';
/**
* Share controller.
*/
App.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.data.status == 403) {
// TODO Sharing no more valid
}
});
// Load files
Restangular.one('file').getList('list', { id: $stateParams.documentId, share: $stateParams.shareId })
.then(function (data) {
$scope.files = data.files;
});
});