Merge pull request #923 from sharelatex/cmg-share-modal

Show share button for collaborators
This commit is contained in:
Chrystal Maria Griffiths 2018-09-17 15:19:44 +01:00 committed by GitHub
commit 784984dd78
5 changed files with 16 additions and 26 deletions

View file

@ -103,12 +103,8 @@ header.toolbar.toolbar-header.toolbar-with-labels(
a.btn.btn-full-height(
href
ng-class="{ 'btn-full-height-disabled' : !permissions.admin }"
ng-click="openShareProjectModal(permissions.admin);"
ng-controller="ShareController"
tooltip-enable="!permissions.admin"
tooltip="Only the project owner can use the Share menu at the moment, but we're working on making it accessible to collaborators, too."
tooltip-placement="bottom"
)
i.fa.fa-fw.fa-group
p.toolbar-label #{translate("share")}

View file

@ -8,9 +8,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
h3 #{translate("share_project")}
.modal-body.modal-body-share
.container-fluid
//- Private (with token-access available)
.row.public-access-level(ng-show="project.publicAccesLevel == 'private'")
.row.public-access-level(ng-show="isAdmin && project.publicAccesLevel == 'private'")
.col-xs-12.text-center
| #{translate('link_sharing_is_off')}
|   
@ -28,7 +27,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
)
//- Token-based access
.row.public-access-level(ng-show="project.publicAccesLevel == 'tokenBased'")
.row.public-access-level(ng-show="isAdmin && project.publicAccesLevel == 'tokenBased'")
.col-xs-12.text-center
strong
| #{translate('link_sharing_is_on')}.
@ -57,7 +56,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
pre.access-token(ng-hide="readOnlyTokenLink") #{translate('loading')}...
//- legacy public-access
.row.public-access-level(ng-show="project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly'")
.row.public-access-level(ng-show="isAdmin && (project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly')")
.col-xs-12.text-center
strong(ng-if="project.publicAccesLevel == 'readAndWrite'") #{translate("this_project_is_public")}
strong(ng-if="project.publicAccesLevel == 'readOnly'") #{translate("this_project_is_public_read_only")}
@ -77,7 +76,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
.col-xs-3.text-left
span(ng-show="member.privileges == 'readAndWrite'") #{translate("can_edit")}
span(ng-show="member.privileges == 'readOnly'") #{translate("read_only")}
.col-xs-1
.col-xs-1(ng-show="isAdmin")
a(
href
tooltip=translate('remove_collaborator')
@ -102,7 +101,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
ng-click="revokeInvite(invite)"
)
i.fa.fa-times
.row.invite-controls
.row.invite-controls(ng-show="isAdmin")
form(ng-show="canAddCollaborators")
.small #{translate("share_with_your_collabs")}
.form-group
@ -177,8 +176,9 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
) #{translate("start_free_trial")}
p.small(ng-show="startedFreeTrial")
| #{translate("refresh_page_after_starting_free_trial")}.
| #{translate("refresh_page_after_starting_free_trial")}
.row.public-access-level.public-access-level--notice(ng-show="!isAdmin")
.col-xs-12.text-center #{translate("to_add_more_collaborators")}
.modal-footer.modal-footer-share
.modal-footer-left
i.fa.fa-refresh.fa-spin(ng-show="state.inflight")

View file

@ -4,9 +4,7 @@ define [
App.controller "ShareController", ["$scope", "$modal", "ide", "projectInvites", "projectMembers", "event_tracking",
($scope, $modal, ide, projectInvites, projectMembers, event_tracking) ->
$scope.openShareProjectModal = (isAdmin) ->
if !isAdmin
return
$scope.isAdmin = isAdmin;
event_tracking.sendMBOnce "ide-open-share-modal-once"
$modal.open(

View file

@ -30,6 +30,13 @@
}
}
.public-access-level.public-access-level--notice {
background-color: @gray-lightest;
border-bottom: none;
margin-top: @margin-md;
padding-top: @margin-md;
}
.project-member, .project-invite {
&:hover {
background-color: @gray-lightest;

View file

@ -72,17 +72,6 @@
background-color: @toolbar-btn-active-bg-color;
box-shadow: @toolbar-btn-active-shadow;
}
&.btn-full-height-disabled {
opacity: 0.65;
&:hover,
&.active,
&:active {
text-shadow: none;
background-color: transparent;
color: @toolbar-btn-color;
box-shadow: none;
}
}
.label {
top: 4px;
right: 4px;