mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-20 14:22:25 +01:00
fix(core menu): Menuize the account routes so they can be added to by submodules
Newlines fix Removed Comment
This commit is contained in:
45
modules/core/client/config/core.client.menus.js
Normal file
45
modules/core/client/config/core.client.menus.js
Normal 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'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user