From fc7b5bdd6324bcb34581023742732cb2e6ba4855 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Fri, 31 Aug 2018 15:33:56 +0100 Subject: [PATCH] * Share button shown to all users, with a tooltip for non-admin; remove its id. --- services/web/app/views/project/editor/header.pug | 14 +++++++++----- .../ide/share/controllers/ShareController.coffee | 5 ++++- .../web/public/stylesheets/app/editor/toolbar.less | 11 +++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/project/editor/header.pug b/services/web/app/views/project/editor/header.pug index 03b56d9e20..233b2a77b7 100644 --- a/services/web/app/views/project/editor/header.pug +++ b/services/web/app/views/project/editor/header.pug @@ -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")} diff --git a/services/web/public/coffee/ide/share/controllers/ShareController.coffee b/services/web/public/coffee/ide/share/controllers/ShareController.coffee index b4a1d7652b..e729b92f08 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareController.coffee @@ -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( diff --git a/services/web/public/stylesheets/app/editor/toolbar.less b/services/web/public/stylesheets/app/editor/toolbar.less index dcc0344c73..aeea9da50a 100644 --- a/services/web/public/stylesheets/app/editor/toolbar.less +++ b/services/web/public/stylesheets/app/editor/toolbar.less @@ -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;