Add ability to show/hide the new token-access ui

This commit is contained in:
Shane Kilkelly 2017-10-30 13:48:25 +00:00
parent 14633fe867
commit 5fe5125a5c
4 changed files with 48 additions and 17 deletions

View file

@ -315,6 +315,7 @@ module.exports = ProjectController =
languages: Settings.languages
themes: THEME_LIST
maxDocLength: Settings.max_doc_length
enableTokenAccessUI: true
timer.done()
_buildProjectList: (allProjects)->

View file

@ -125,6 +125,7 @@ block requirejs
window.showTrackChangesOnboarding = #{!!showTrackChangesOnboarding};
window.showPerUserTCNotice = #{!!showPerUserTCNotice};
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
window.enableTokenAccessUI = #{enableTokenAccessUI}
window.requirejs = {
"paths" : {
"mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {cdn:false, fingerprint:false, qs:{config:'TeX-AMS_HTML'}})}",

View file

@ -10,7 +10,17 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
.container-fluid
//- Private
.row.public-access-level(ng-show="project.publicAccesLevel == 'private'")
.row.public-access-level(ng-show="project.publicAccesLevel == 'private' && __enableTokenAccessUI == false")
.col-xs-12.text-center
| #{translate("this_project_is_private")}
|   
a(
href
ng-click="openMakePublicModal()"
) #{translate("make_public")}
//- Private (with token-access available)
.row.public-access-level(ng-show="project.publicAccesLevel == 'private' && __enableTokenAccessUI == true")
.col-xs-12.text-center
| #{translate('link_sharing_is_off')}.
|   
@ -244,22 +254,40 @@ script(type="text/ng-template", id="makeTokenBasedModalTemplate")
) #{translate('turn_on_link_sharing')}
script(type="text/ng-template", id="makePrivateModalTemplate")
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="cancel()"
) ×
h3 #{translate("make_project_private")}?
.modal-body.modal-body-share
p #{translate('turn_off_link_sharing_consequences')}
.modal-footer
button.btn.btn-default(
ng-click="cancel()"
) #{translate("cancel")}
button.btn.btn-info(
ng-click="makePrivate()"
) #{translate("turn_off_link_sharing")}
div(ng-if="__enableTokenAccessUI")
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="cancel()"
) ×
h3 #{translate("make_project_private")}?
.modal-body.modal-body-share
p #{translate('turn_off_link_sharing_consequences')}
.modal-footer
button.btn.btn-default(
ng-click="cancel()"
) #{translate("cancel")}
button.btn.btn-info(
ng-click="makePrivate()"
) #{translate("turn_off_link_sharing")}
div(ng-if="!__enableTokenAccessUI")
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="cancel()"
) ×
h3 #{translate("make_project_private")}?
.modal-body.modal-body-share
p #{translate("make_project_private_consequences")}
.modal-footer
button.btn.btn-default(
ng-click="cancel()"
) #{translate("cancel")}
button.btn.btn-info(
ng-click="makePrivate()"
) #{translate("make_private")}
script(type="text/ng-template", id="shareTagTemplate")
.tag-template

View file

@ -3,6 +3,7 @@ define [
], (App) ->
App.controller "ShareController", ["$scope", "$modal", "ide", "projectInvites", "projectMembers", "event_tracking",
($scope, $modal, ide, projectInvites, projectMembers, event_tracking) ->
$scope.__enableTokenAccessUI = window.enableTokenAccessUI == true
$scope.openShareProjectModal = () ->
event_tracking.sendMBOnce "ide-open-share-modal-once"