fix(core menu): Menuize the account routes so they can be added to by submodules

Newlines fix

Removed Comment
This commit is contained in:
Andrew Throener
2016-01-19 19:36:15 -06:00
parent 3ab760a1e0
commit 48eabd02ed
3 changed files with 50 additions and 11 deletions

View File

@@ -0,0 +1,45 @@
(function () {
'use strict';
angular
.module('core')
.run(MenuConfig);
MenuConfig.$inject = ['Menus'];
function MenuConfig(Menus) {
Menus.addMenu('account', {
roles: ['user']
});
Menus.addMenuItem('account', {
title: '',
state: 'settings',
type: 'dropdown',
roles: ['user']
});
Menus.addSubMenuItem('account', 'settings', {
title: 'Edit Profile',
state: 'settings.profile'
});
Menus.addSubMenuItem('account', 'settings', {
title: 'Edit Profile Picture',
state: 'settings.picture'
});
Menus.addSubMenuItem('account', 'settings', {
title: 'Change Password',
state: 'settings.password'
});
Menus.addSubMenuItem('account', 'settings', {
title: 'Manage Social Accounts',
state: 'settings.accounts'
});
}
})();

View File

@@ -9,6 +9,9 @@ angular.module('core').controller('HeaderController', ['$scope', '$state', 'Auth
// Get the topbar menu
$scope.menu = Menus.getMenu('topbar');
// Get the account menu
$scope.accountMenu = Menus.getMenu('account').items[0];
// Toggle the menu items
$scope.isCollapsed = false;
$scope.toggleCollapsibleMenu = function () {

View File

@@ -36,17 +36,8 @@
<span ng-bind="authentication.user.displayName"></span> <b class="caret"></b>
</a>
<ul class="dropdown-menu" role="menu">
<li ui-sref-active="active">
<a ui-sref="settings.profile">Edit Profile</a>
</li>
<li ui-sref-active="active">
<a ui-sref="settings.picture">Change Profile Picture</a>
</li>
<li ui-sref-active="active" ng-show="authentication.user.provider === 'local'">
<a ui-sref="settings.password">Change Password</a>
</li>
<li ui-sref-active="active">
<a ui-sref="settings.accounts">Manage Social Accounts</a>
<li ui-sref-active="active" ng-repeat="item in accountMenu.items">
<a ui-sref="{{item.state}}" ng-bind="item.title"></a>
</li>
<li class="divider"></li>
<li>