From c9da356c98dced9b8e96e313ba5d8f9fccf97601 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Thu, 11 Feb 2016 10:48:05 +0100 Subject: [PATCH] add user-menu options with plugins --- .../dropdown-user/dropdown-user.directive.coffee | 7 +++++-- .../navigation-bar/dropdown-user/dropdown-user.jade | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee b/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee index ac09365c..6602996e 100644 --- a/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee +++ b/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee @@ -18,7 +18,7 @@ ### DropdownUserDirective = (authService, configService, locationService, - navUrlsService, feedbackService) -> + navUrlsService, feedbackService, $rootScope) -> link = (scope, el, attrs, ctrl) -> scope.vm = {} @@ -33,6 +33,8 @@ DropdownUserDirective = (authService, configService, locationService, scope.vm.sendFeedback = -> feedbackService.sendFeedback() + scope.vm.userSettingsPlugins = _.filter($rootScope.userSettingsPlugins, {userMenu: true}) + directive = { templateUrl: "navigation-bar/dropdown-user/dropdown-user.html" scope: {} @@ -46,7 +48,8 @@ DropdownUserDirective.$inject = [ "$tgConfig", "$tgLocation", "$tgNavUrls", - "tgFeedbackService" + "tgFeedbackService", + "$rootScope" ] angular.module("taigaNavigationBar").directive("tgDropdownUser", DropdownUserDirective) diff --git a/app/modules/navigation-bar/dropdown-user/dropdown-user.jade b/app/modules/navigation-bar/dropdown-user/dropdown-user.jade index 7d3d275e..0061c6e4 100644 --- a/app/modules/navigation-bar/dropdown-user/dropdown-user.jade +++ b/app/modules/navigation-bar/dropdown-user/dropdown-user.jade @@ -22,6 +22,15 @@ div.navbar-dropdown.dropdown-user tg-nav="user-settings-user-profile", title="{{'PROJECT.NAVIGATION.EDIT_PROFILE_TITLE' | translate}}", translate="PROJECT.NAVIGATION.EDIT_PROFILE") + + li(ng-repeat="plugin in vm.userSettingsPlugins") + a( + href="" + tg-nav="user-settings-contrib:plugin=plugin.slug" + ng-class="{active: plugin.slug == currentPlugin.slug}" + ) + span.title {{ plugin.name }} + li a( href="#",