Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fix(core menu): Menuize the account routes so they can be added to by…
Browse files Browse the repository at this point in the history
… submodules

Newlines fix

Removed Comment
  • Loading branch information
trainerbill committed Jan 26, 2016
1 parent 3ab760a commit 48eabd0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
45 changes: 45 additions & 0 deletions modules/core/client/config/core.client.menus.js
Original file line number Diff line number Diff line change
@@ -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'
});

}

})();
3 changes: 3 additions & 0 deletions modules/core/client/controllers/header.client.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
13 changes: 2 additions & 11 deletions modules/core/client/views/header.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 48eabd0

Please sign in to comment.