From 00070ebc245d34f03b773bb486db26850695f3cf Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 1 Jun 2015 08:24:18 +0200 Subject: [PATCH] Issue 2772 - projects tab mustn't appear in your profile --- .../profile/profile-tab/profile-tab.directive.coffee | 6 +++--- app/modules/profile/profile.controller.coffee | 2 ++ app/modules/profile/profile.jade | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/modules/profile/profile-tab/profile-tab.directive.coffee b/app/modules/profile/profile-tab/profile-tab.directive.coffee index a15c0f30..e3c1dcbc 100644 --- a/app/modules/profile/profile-tab/profile-tab.directive.coffee +++ b/app/modules/profile/profile-tab/profile-tab.directive.coffee @@ -9,15 +9,15 @@ ProfileTabDirective = () -> scope.tab.icon = attrs.tabIcon scope.tab.active = !!attrs.tabActive - ctrl.addTab(scope.tab) + if scope.$eval(attrs.tabDisabled) != false + ctrl.addTab(scope.tab) return { templateUrl: "profile/profile-tab/profile-tab.html", scope: {}, require: "^tgProfileTabs", link: link, - transclude: true, - replace: true + transclude: true } angular.module("taigaProfile") diff --git a/app/modules/profile/profile.controller.coffee b/app/modules/profile/profile.controller.coffee index 12ceb615..c132a7bc 100644 --- a/app/modules/profile/profile.controller.coffee +++ b/app/modules/profile/profile.controller.coffee @@ -7,6 +7,8 @@ class ProfilePageController extends taiga.Controller ] constructor: (@appTitle, @currentUserService, @routeParams, @userService) -> + @.isCurrentUser = false + if @routeParams.slug @userService .getUserByUserName(@routeParams.slug) diff --git a/app/modules/profile/profile.jade b/app/modules/profile/profile.jade index 69f49ada..9996b8b6 100644 --- a/app/modules/profile/profile.jade +++ b/app/modules/profile/profile.jade @@ -6,7 +6,7 @@ div.profile.centered(ng-if="vm.user") div(tg-profile-tab="activity", tab-title="{{'USER.PROFILE.ACTIVITY_TAB' | translate}}", tab-icon="icon-timeline", tab-active) div(tg-user-timeline, userId="vm.user.get('id')") - div(tg-profile-tab="projects", tab-title="{{'USER.PROFILE.PROJECTS_TAB' | translate}}", tab-icon="icon-project") + div(tab-disabled="{{vm.isCurrentUser}}", tg-profile-tab="projects", tab-title="{{'USER.PROFILE.PROJECTS_TAB' | translate}}", tab-icon="icon-project") div(tg-profile-projects, userId="vm.user.get('id')") div(tg-profile-tab="contacts", tab-title="{{'USER.PROFILE.CONTACTS_TAB' | translate}}", tab-icon="icon-team")