add user-menu options with plugins

stable
Juanfran 2016-02-11 10:48:05 +01:00
parent a5a80bb9a8
commit c9da356c98
2 changed files with 14 additions and 2 deletions

View File

@ -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)

View File

@ -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="#",