diff --git a/services/web/app/views/project/editor/share.pug b/services/web/app/views/project/editor/share.pug index d96c14ba0e..98513dc49b 100644 --- a/services/web/app/views/project/editor/share.pug +++ b/services/web/app/views/project/editor/share.pug @@ -49,10 +49,12 @@ script(type='text/ng-template', id='shareProjectModalTemplate') .col-xs-12.access-token-display-area div.access-token-wrapper strong #{translate('anyone_with_link_can_edit')} - pre.access-token {{ getReadAndWriteTokenLink() }} + pre.access-token(ng-show="readAndWriteTokenLink") {{ readAndWriteTokenLink }} + pre.access-token(ng-hide="readAndWriteTokenLink") #{translate('loading')}... div.access-token-wrapper strong #{translate('anyone_with_link_can_view')} - pre.access-token {{ getReadOnlyTokenLink() }} + pre.access-token(ng-show="readOnlyTokenLink") {{ readOnlyTokenLink }} + pre.access-token(ng-hide="readOnlyTokenLink") #{translate('loading')}... //- legacy public-access .row.public-access-level(ng-show="project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly'") diff --git a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee index ce3f00fa01..ed3382141d 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee @@ -189,17 +189,17 @@ define [ $scope.project.publicAccesLevel = "private" settings.saveProjectAdminSettings({publicAccessLevel: "private"}) - $scope.getReadAndWriteTokenLink = () -> - if $scope?.project?.tokens?.readAndWrite? - location.origin + "/" + $scope.project.tokens.readAndWrite + $scope.$watch "project.tokens.readAndWrite", (token) -> + if token? + $scope.readAndWriteTokenLink = "#{location.origin}/#{token}" else - '' + $scope.readAndWriteTokenLink = null - $scope.getReadOnlyTokenLink = () -> - if $scope?.project?.tokens?.readOnly? - location.origin + "/read/" + $scope.project.tokens.readOnly + $scope.$watch "project.tokens.readOnly", (token) -> + if token? + $scope.readOnlyTokenLink = "#{location.origin}/#{token}" else - '' + $scope.readOnlyTokenLink = null $scope.done = () -> $modalInstance.close()