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 .col-xs-12.access-token-display-area
div.access-token-wrapper div.access-token-wrapper
strong #{translate('anyone_with_link_can_edit')} 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 div.access-token-wrapper
strong #{translate('anyone_with_link_can_view')} 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 //- legacy public-access
.row.public-access-level(ng-show="project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly'") .row.public-access-level(ng-show="project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly'")

View file

@ -189,17 +189,17 @@ define [
$scope.project.publicAccesLevel = "private" $scope.project.publicAccesLevel = "private"
settings.saveProjectAdminSettings({publicAccessLevel: "private"}) settings.saveProjectAdminSettings({publicAccessLevel: "private"})
$scope.getReadAndWriteTokenLink = () -> $scope.$watch "project.tokens.readAndWrite", (token) ->
if $scope?.project?.tokens?.readAndWrite? if token?
location.origin + "/" + $scope.project.tokens.readAndWrite $scope.readAndWriteTokenLink = "#{location.origin}/#{token}"
else else
'' $scope.readAndWriteTokenLink = null
$scope.getReadOnlyTokenLink = () -> $scope.$watch "project.tokens.readOnly", (token) ->
if $scope?.project?.tokens?.readOnly? if token?
location.origin + "/read/" + $scope.project.tokens.readOnly $scope.readOnlyTokenLink = "#{location.origin}/#{token}"
else else
'' $scope.readOnlyTokenLink = null
$scope.done = () -> $scope.done = () ->
$modalInstance.close() $modalInstance.close()