{"action":"created","comment":{"url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/comments/50097913","id":50097913,"diff_hunk":"@@ -0,0 +1,152 @@\n+\n+angular\n+        .module('openeApp.files')\n+        .controller('filesController', FilesController);\n+\n+function FilesController(filesService, $translate, $mdDialog, notificationUtilsService,\n+        alfrescoDownloadService, documentPreviewService, userService) {\n+    var vm = this;\n+    vm.tab = 'my_files';\n+    vm.files = [];\n+    vm.loadList = loadList;\n+    vm.showAddFileDialog = showAddFileDialog;\n+    vm.downloadFile = downloadFile;\n+    vm.previewFile = previewFile;\n+    vm.deleteFile = deleteFile;\n+    vm.assignFile = assignFile;\n+    loadList();\n+    function loadList() {\n+        vm.files = [];\n+        var listF = vm.tab === 'my_files'\n+                ? filesService.getUserFiles\n+                : filesService.getGroupFiles;\n+        listF().then(function(files) {\n+            vm.files = files;\n+        }, function(error) {\n+            notificationUtilsService.alert(error.data.message || 'Unexpected exception');\n+            console.log(error);\n+        });\n+    }\n+\n+    function downloadFile(file) {\n+        alfrescoDownloadService.downloadFile(file.nodeRef, file.name);\n+    }\n+\n+    function previewFile(file) {\n+        documentPreviewService.previewDocument(file.nodeRef);\n+    }\n+\n+    function deleteFile(file) {\n+        var confirm = $mdDialog.confirm()\n+                .title($translate.instant('COMMON.CONFIRM'))\n+                .textContent($translate.instant('FILE.ARE_YOU_SURE_YOU_WANT_TO_DELETE_FILE', {title: file.title}))\n+                .ariaLabel('File delete confirmation')\n+                .targetEvent(null)\n+                .ok($translate.instant('COMMON.YES'))\n+                .cancel($translate.instant('COMMON.CANCEL'));\n+        $mdDialog.show(confirm).then(function() {\n+            filesService.deleteFile(file.nodeRef)\n+                    .then(function() {\n+                        loadList();\n+                        notificationUtilsService.notify($translate.instant('FILE.DELETE_FILE_SUCCESS'));\n+                    }, function(response) {\n+                        console.log(response);\n+                        notificationUtilsService.alert($translate.instant('FILE.DELETE_FILE_FAILURE'));\n+                    });\n+        });\n+    }\n+\n+    function showAddFileDialog(ev) {\n+        userService.getAuthorities().then(function(authorities) {\n+            $mdDialog.show({\n+                controller: AddFileDialogController,\n+                controllerAs: 'addFileVm',\n+                templateUrl: '/app/src/files/view/addFiles.html',","path":"app/src/files/filesController.js","position":64,"original_position":64,"commit_id":"be95df1b0bf52843b4229627a8c877b73323588f","original_commit_id":"be95df1b0bf52843b4229627a8c877b73323588f","user":{"login":"jrudinskij","id":12148761,"avatar_url":"https://avatars.githubusercontent.com/u/12148761?v=3","gravatar_id":"","url":"https://api.github.com/users/jrudinskij","html_url":"https://github.com/jrudinskij","followers_url":"https://api.github.com/users/jrudinskij/followers","following_url":"https://api.github.com/users/jrudinskij/following{/other_user}","gists_url":"https://api.github.com/users/jrudinskij/gists{/gist_id}","starred_url":"https://api.github.com/users/jrudinskij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrudinskij/subscriptions","organizations_url":"https://api.github.com/users/jrudinskij/orgs","repos_url":"https://api.github.com/users/jrudinskij/repos","events_url":"https://api.github.com/users/jrudinskij/events{/privacy}","received_events_url":"https://api.github.com/users/jrudinskij/received_events","type":"User","site_admin":false},"body":"The same here. Leading slash fails to load templates in multi tenant env.","created_at":"2016-01-19T10:49:53Z","updated_at":"2016-01-19T10:49:53Z","html_url":"https://github.com/OpenESDH/OpenESDH-UI/pull/137#discussion_r50097913","pull_request_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/comments/50097913"},"html":{"href":"https://github.com/OpenESDH/OpenESDH-UI/pull/137#discussion_r50097913"},"pull_request":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137","id":56444359,"html_url":"https://github.com/OpenESDH/OpenESDH-UI/pull/137","diff_url":"https://github.com/OpenESDH/OpenESDH-UI/pull/137.diff","patch_url":"https://github.com/OpenESDH/OpenESDH-UI/pull/137.patch","issue_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/137","number":137,"state":"open","locked":false,"title":"OPENE-432 User/group files","user":{"login":"ArnasPetraitis","id":14013225,"avatar_url":"https://avatars.githubusercontent.com/u/14013225?v=3","gravatar_id":"","url":"https://api.github.com/users/ArnasPetraitis","html_url":"https://github.com/ArnasPetraitis","followers_url":"https://api.github.com/users/ArnasPetraitis/followers","following_url":"https://api.github.com/users/ArnasPetraitis/following{/other_user}","gists_url":"https://api.github.com/users/ArnasPetraitis/gists{/gist_id}","starred_url":"https://api.github.com/users/ArnasPetraitis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArnasPetraitis/subscriptions","organizations_url":"https://api.github.com/users/ArnasPetraitis/orgs","repos_url":"https://api.github.com/users/ArnasPetraitis/repos","events_url":"https://api.github.com/users/ArnasPetraitis/events{/privacy}","received_events_url":"https://api.github.com/users/ArnasPetraitis/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-19T10:06:20Z","updated_at":"2016-01-19T10:49:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cefe04c67980ec42c1bdc2bb6de640be5699da5b","assignee":{"login":"jrudinskij","id":12148761,"avatar_url":"https://avatars.githubusercontent.com/u/12148761?v=3","gravatar_id":"","url":"https://api.github.com/users/jrudinskij","html_url":"https://github.com/jrudinskij","followers_url":"https://api.github.com/users/jrudinskij/followers","following_url":"https://api.github.com/users/jrudinskij/following{/other_user}","gists_url":"https://api.github.com/users/jrudinskij/gists{/gist_id}","starred_url":"https://api.github.com/users/jrudinskij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrudinskij/subscriptions","organizations_url":"https://api.github.com/users/jrudinskij/orgs","repos_url":"https://api.github.com/users/jrudinskij/repos","events_url":"https://api.github.com/users/jrudinskij/events{/privacy}","received_events_url":"https://api.github.com/users/jrudinskij/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137/commits","review_comments_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137/comments","review_comment_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/137/comments","statuses_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/statuses/be95df1b0bf52843b4229627a8c877b73323588f","head":{"label":"OpenESDH:feature/OPENE-432-UI","ref":"feature/OPENE-432-UI","sha":"be95df1b0bf52843b4229627a8c877b73323588f","user":{"login":"OpenESDH","id":8580006,"avatar_url":"https://avatars.githubusercontent.com/u/8580006?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenESDH","html_url":"https://github.com/OpenESDH","followers_url":"https://api.github.com/users/OpenESDH/followers","following_url":"https://api.github.com/users/OpenESDH/following{/other_user}","gists_url":"https://api.github.com/users/OpenESDH/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenESDH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenESDH/subscriptions","organizations_url":"https://api.github.com/users/OpenESDH/orgs","repos_url":"https://api.github.com/users/OpenESDH/repos","events_url":"https://api.github.com/users/OpenESDH/events{/privacy}","received_events_url":"https://api.github.com/users/OpenESDH/received_events","type":"Organization","site_admin":false},"repo":{"id":41536120,"name":"OpenESDH-UI","full_name":"OpenESDH/OpenESDH-UI","owner":{"login":"OpenESDH","id":8580006,"avatar_url":"https://avatars.githubusercontent.com/u/8580006?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenESDH","html_url":"https://github.com/OpenESDH","followers_url":"https://api.github.com/users/OpenESDH/followers","following_url":"https://api.github.com/users/OpenESDH/following{/other_user}","gists_url":"https://api.github.com/users/OpenESDH/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenESDH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenESDH/subscriptions","organizations_url":"https://api.github.com/users/OpenESDH/orgs","repos_url":"https://api.github.com/users/OpenESDH/repos","events_url":"https://api.github.com/users/OpenESDH/events{/privacy}","received_events_url":"https://api.github.com/users/OpenESDH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenESDH/OpenESDH-UI","description":"OpenESDH UI","fork":false,"url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI","forks_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/forks","keys_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/teams","hooks_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/hooks","issue_events_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/events{/number}","events_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/events","assignees_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/assignees{/user}","branches_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/branches{/branch}","tags_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/tags","blobs_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/languages","stargazers_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/stargazers","contributors_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/contributors","subscribers_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/subscribers","subscription_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/subscription","commits_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/contents/{+path}","compare_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/merges","archive_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/downloads","issues_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues{/number}","pulls_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/labels{/name}","releases_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/releases{/id}","created_at":"2015-08-28T08:30:09Z","updated_at":"2016-01-11T13:35:15Z","pushed_at":"2016-01-19T10:06:21Z","git_url":"git://github.com/OpenESDH/OpenESDH-UI.git","ssh_url":"git@github.com:OpenESDH/OpenESDH-UI.git","clone_url":"https://github.com/OpenESDH/OpenESDH-UI.git","svn_url":"https://github.com/OpenESDH/OpenESDH-UI","homepage":"","size":1925,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"develop"}},"base":{"label":"OpenESDH:develop","ref":"develop","sha":"35dd9e2899284713d1af556432da3a30161c9fe9","user":{"login":"OpenESDH","id":8580006,"avatar_url":"https://avatars.githubusercontent.com/u/8580006?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenESDH","html_url":"https://github.com/OpenESDH","followers_url":"https://api.github.com/users/OpenESDH/followers","following_url":"https://api.github.com/users/OpenESDH/following{/other_user}","gists_url":"https://api.github.com/users/OpenESDH/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenESDH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenESDH/subscriptions","organizations_url":"https://api.github.com/users/OpenESDH/orgs","repos_url":"https://api.github.com/users/OpenESDH/repos","events_url":"https://api.github.com/users/OpenESDH/events{/privacy}","received_events_url":"https://api.github.com/users/OpenESDH/received_events","type":"Organization","site_admin":false},"repo":{"id":41536120,"name":"OpenESDH-UI","full_name":"OpenESDH/OpenESDH-UI","owner":{"login":"OpenESDH","id":8580006,"avatar_url":"https://avatars.githubusercontent.com/u/8580006?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenESDH","html_url":"https://github.com/OpenESDH","followers_url":"https://api.github.com/users/OpenESDH/followers","following_url":"https://api.github.com/users/OpenESDH/following{/other_user}","gists_url":"https://api.github.com/users/OpenESDH/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenESDH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenESDH/subscriptions","organizations_url":"https://api.github.com/users/OpenESDH/orgs","repos_url":"https://api.github.com/users/OpenESDH/repos","events_url":"https://api.github.com/users/OpenESDH/events{/privacy}","received_events_url":"https://api.github.com/users/OpenESDH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenESDH/OpenESDH-UI","description":"OpenESDH UI","fork":false,"url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI","forks_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/forks","keys_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/teams","hooks_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/hooks","issue_events_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/events{/number}","events_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/events","assignees_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/assignees{/user}","branches_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/branches{/branch}","tags_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/tags","blobs_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/languages","stargazers_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/stargazers","contributors_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/contributors","subscribers_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/subscribers","subscription_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/subscription","commits_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/contents/{+path}","compare_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/merges","archive_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/downloads","issues_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues{/number}","pulls_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/labels{/name}","releases_url":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/releases{/id}","created_at":"2015-08-28T08:30:09Z","updated_at":"2016-01-11T13:35:15Z","pushed_at":"2016-01-19T10:06:21Z","git_url":"git://github.com/OpenESDH/OpenESDH-UI.git","ssh_url":"git@github.com:OpenESDH/OpenESDH-UI.git","clone_url":"https://github.com/OpenESDH/OpenESDH-UI.git","svn_url":"https://github.com/OpenESDH/OpenESDH-UI","homepage":"","size":1925,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137"},"html":{"href":"https://github.com/OpenESDH/OpenESDH-UI/pull/137"},"issue":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/137"},"comments":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/OpenESDH/OpenESDH-UI/statuses/be95df1b0bf52843b4229627a8c877b73323588f"}}}}