* Share button shown to all users, with a tooltip for non-admin; remove its id.

This commit is contained in:
Paulo Reis 2018-08-31 15:33:56 +01:00
parent 855840d89a
commit fc7b5bdd63
3 changed files with 24 additions and 6 deletions

View file

@ -99,11 +99,15 @@ header.toolbar.toolbar-header.toolbar-with-labels(
i.review-icon
p.toolbar-label
| #{translate("review")}
a.btn.btn-full-height#shareButton(
href,
ng-if="permissions.admin",
ng-click="openShareProjectModal();",
ng-controller="ShareController",
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

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

View file

@ -72,6 +72,17 @@
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;