1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

basic manager menu

This commit is contained in:
Sylvain 2020-04-22 12:31:44 +02:00
parent c30ae8179e
commit c45c92e86a
4 changed files with 29 additions and 16 deletions

View File

@ -81,59 +81,70 @@ Application.Controllers.controller('MainNavController', ['$scope', function ($sc
{
state: 'app.admin.calendar',
linkText: 'app.public.common.manage_the_calendar',
linkIcon: 'calendar'
linkIcon: 'calendar',
authorizedRoles: ['admin', 'manager']
},
{
state: 'app.public.machines_list',
linkText: 'app.public.common.manage_the_machines',
linkIcon: 'cogs'
linkIcon: 'cogs',
authorizedRoles: ['admin', 'manager']
},
{
state: 'app.admin.trainings',
linkText: 'app.public.common.trainings_monitoring',
linkIcon: 'graduation-cap'
linkIcon: 'graduation-cap',
authorizedRoles: ['admin', 'manager']
},
{
state: 'app.admin.events',
linkText: 'app.public.common.manage_the_events',
linkIcon: 'tags'
linkIcon: 'tags',
authorizedRoles: ['admin', 'manager']
},
{ class: 'menu-spacer' },
{
state: 'app.admin.members',
linkText: 'app.public.common.manage_the_users',
linkIcon: 'users'
linkIcon: 'users',
authorizedRoles: ['admin', 'manager']
},
{
state: 'app.admin.pricing',
linkText: 'app.public.common.subscriptions_and_prices',
linkIcon: 'money'
linkIcon: 'money',
authorizedRoles: ['admin']
},
{
state: 'app.admin.invoices',
linkText: 'app.public.common.manage_the_invoices',
linkIcon: 'file-pdf-o'
linkIcon: 'file-pdf-o',
authorizedRoles: ['admin']
},
{
state: 'app.admin.statistics',
linkText: 'app.public.common.statistics',
linkIcon: 'bar-chart-o'
linkIcon: 'bar-chart-o',
authorizedRoles: ['admin']
},
{ class: 'menu-spacer' },
{
state: 'app.admin.settings',
linkText: 'app.public.common.customization',
linkIcon: 'gear'
linkIcon: 'gear',
authorizedRoles: ['admin']
},
{
state: 'app.admin.project_elements',
linkText: 'app.public.common.manage_the_projects_elements',
linkIcon: 'tasks'
linkIcon: 'tasks',
authorizedRoles: ['admin']
},
{
state: 'app.admin.open_api_clients',
linkText: 'app.public.common.open_api_clients',
linkIcon: 'cloud'
linkIcon: 'cloud',
authorizedRoles: ['admin']
}
].concat(Fablab.adminNavLinks);

View File

@ -55,7 +55,7 @@ angular.module('application.router', ['ui.router'])
.state('app.logged', {
abstract: true,
data: {
authorizedRoles: ['member', 'admin']
authorizedRoles: ['member', 'admin', 'manager']
},
resolve: {
currentUser: ['Auth', function (Auth) { return Auth.currentUser(); }],
@ -68,7 +68,7 @@ angular.module('application.router', ['ui.router'])
.state('app.admin', {
abstract: true,
data: {
authorizedRoles: ['admin']
authorizedRoles: ['admin', 'manager']
},
resolve: {
currentUser: ['Auth', function (Auth) { return Auth.currentUser(); }],

View File

@ -71,10 +71,11 @@
</ul>
<!-- Admin entries -->
<div class="line-s bg-red-dark dk " ng-if="isAuthorized('admin')"></div>
<div class="line-s bg-red-dark dk " ng-if="isAuthorized(['admin', 'manager'])"></div>
<div class="text-xs font-bold text-bordeau hidden-nav-xs padder m-t-lg m-b-sm admin-section" ng-if="isAuthorized('admin')" translate>{{ 'app.public.common.admin' }}</div>
<ul class="nav" ng-if="isAuthorized('admin')">
<li class="{{navLink.class}}" ng-repeat="navLink in adminNavLinks">
<div class="text-xs font-bold text-bordeau hidden-nav-xs padder m-t-lg m-b-sm admin-section" ng-if="isAuthorized('manager')" translate>{{ 'app.public.common.manager' }}</div>
<ul class="nav" ng-if="isAuthorized(['admin', 'manager'])">
<li class="{{navLink.class}}" ng-repeat="navLink in adminNavLinks" ng-if="!navLink.authorizedRoles || isAuthorized(navLink.authorizedRoles)">
<a ng-click="toggleNavSize($event)" ga ui-sref="{{navLink.state}}" ui-sref-active="active" class="auto" data-toggle="class:nav-off-screen" data-target="#nav" ng-if="navLink.state">
<i class="fa fa-{{navLink.linkIcon}} fa-lg"></i>
<span>{{navLink.linkText | translate}}</span>

View File

@ -29,6 +29,7 @@ en:
#left menu
notifications: "Notifications"
admin: "Admin"
manager: "Manager"
reduce_panel: "Reduce panel"
#left menu (public)
home: "Home"