Add loading indicator while server returns links

This commit is contained in:
James Allen 2018-02-06 10:00:59 +00:00
parent e7ba75c2e5
commit 37115b8408
2 changed files with 12 additions and 10 deletions

View file

@ -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'")

View file

@ -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()