2018-10-25 16:51:20 +02:00
|
|
|
/* eslint-disable
|
|
|
|
no-undef,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
2018-10-25 16:50:16 +02:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2018-11-21 11:08:53 +01:00
|
|
|
'use strict';
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2018-11-21 09:42:26 +01:00
|
|
|
/**
|
|
|
|
* Navigation controller. List the links availables in the left navigation pane and their icon.
|
|
|
|
*/
|
2018-11-27 13:57:41 +01:00
|
|
|
Application.Controllers.controller('MainNavController', ['$scope', function ($scope) {
|
2018-11-21 09:42:26 +01:00
|
|
|
// Common links (public application)
|
2015-05-05 03:10:25 +02:00
|
|
|
$scope.navLinks = [
|
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.home',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.home',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'home',
|
|
|
|
class: 'home-link'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2020-02-26 18:05:09 +01:00
|
|
|
{ class: 'menu-spacer' },
|
|
|
|
{
|
|
|
|
state: 'app.public.calendar',
|
|
|
|
linkText: 'app.public.common.public_calendar',
|
|
|
|
linkIcon: 'calendar',
|
|
|
|
class: 'public-calendar-link'
|
|
|
|
},
|
2015-05-05 03:10:25 +02:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.machines_list',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.reserve_a_machine',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'cogs',
|
|
|
|
class: 'reserve-machine-link'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2016-03-23 18:39:41 +01:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.trainings_list',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.trainings_registrations',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'graduation-cap',
|
|
|
|
class: 'reserve-training-link'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2015-05-05 03:10:25 +02:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.events_list',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.events_registrations',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'tags',
|
|
|
|
class: 'reserve-event-link'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2020-02-26 18:05:09 +01:00
|
|
|
{ class: 'menu-spacer' },
|
2015-05-05 03:10:25 +02:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.projects_list',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.projects_gallery',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'th',
|
|
|
|
class: 'projects-gallery-link'
|
2020-02-26 18:05:09 +01:00
|
|
|
},
|
|
|
|
{ class: 'menu-spacer' }
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2018-11-21 11:08:53 +01:00
|
|
|
];
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2020-09-23 10:13:41 +02:00
|
|
|
if ($scope.$root.modules.plans) {
|
2016-03-23 18:39:41 +01:00
|
|
|
$scope.navLinks.push({
|
2018-10-25 16:51:20 +02:00
|
|
|
state: 'app.public.plans',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.subscriptions',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'credit-card',
|
|
|
|
class: 'plans-link'
|
2018-11-21 11:08:53 +01:00
|
|
|
});
|
2018-10-25 16:50:16 +02:00
|
|
|
}
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2020-09-23 10:13:41 +02:00
|
|
|
if ($scope.$root.modules.spaces) {
|
2020-02-26 18:05:09 +01:00
|
|
|
$scope.navLinks.splice(4, 0, {
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.spaces_list',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.reserve_a_space',
|
2020-01-28 18:15:11 +01:00
|
|
|
linkIcon: 'rocket',
|
|
|
|
class: 'reserve-space-link'
|
2018-11-21 11:08:53 +01:00
|
|
|
});
|
2018-10-25 16:50:16 +02:00
|
|
|
}
|
2017-02-15 15:41:25 +01:00
|
|
|
|
2018-11-21 11:08:53 +01:00
|
|
|
Fablab.adminNavLinks = Fablab.adminNavLinks || [];
|
2018-10-25 16:50:16 +02:00
|
|
|
const adminNavLinks = [
|
2020-02-26 18:05:09 +01:00
|
|
|
{
|
|
|
|
state: 'app.admin.calendar',
|
|
|
|
linkText: 'app.public.common.manage_the_calendar',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'calendar',
|
|
|
|
authorizedRoles: ['admin', 'manager']
|
2020-02-26 18:05:09 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
state: 'app.public.machines_list',
|
|
|
|
linkText: 'app.public.common.manage_the_machines',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'cogs',
|
|
|
|
authorizedRoles: ['admin', 'manager']
|
2020-02-26 18:05:09 +01:00
|
|
|
},
|
2016-03-23 18:39:41 +01:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.admin.trainings',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.trainings_monitoring',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'graduation-cap',
|
|
|
|
authorizedRoles: ['admin', 'manager']
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2016-03-23 18:39:41 +01:00
|
|
|
{
|
2020-02-26 18:05:09 +01:00
|
|
|
state: 'app.admin.events',
|
|
|
|
linkText: 'app.public.common.manage_the_events',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'tags',
|
|
|
|
authorizedRoles: ['admin', 'manager']
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2020-02-26 18:05:09 +01:00
|
|
|
{ class: 'menu-spacer' },
|
2015-05-05 03:10:25 +02:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.admin.members',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.manage_the_users',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'users',
|
|
|
|
authorizedRoles: ['admin', 'manager']
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2016-03-23 18:39:41 +01:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.admin.pricing',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.subscriptions_and_prices',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'money',
|
|
|
|
authorizedRoles: ['admin']
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2015-05-05 03:10:25 +02:00
|
|
|
{
|
2020-02-26 18:05:09 +01:00
|
|
|
state: 'app.admin.invoices',
|
|
|
|
linkText: 'app.public.common.manage_the_invoices',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'file-pdf-o',
|
2020-04-28 16:35:54 +02:00
|
|
|
authorizedRoles: ['admin', 'manager']
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2020-04-28 16:35:54 +02:00
|
|
|
{
|
|
|
|
class: 'menu-spacer',
|
|
|
|
authorizedRoles: ['admin']
|
|
|
|
},
|
2016-03-23 18:39:41 +01:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.admin.settings',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.customization',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'gear',
|
|
|
|
authorizedRoles: ['admin']
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
2020-02-26 18:05:09 +01:00
|
|
|
{
|
2020-06-01 17:52:39 +02:00
|
|
|
state: 'app.admin.projects',
|
|
|
|
linkText: 'app.public.common.projects',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'tasks',
|
|
|
|
authorizedRoles: ['admin']
|
2020-02-26 18:05:09 +01:00
|
|
|
},
|
2016-05-09 18:15:04 +02:00
|
|
|
{
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.admin.open_api_clients',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.open_api_clients',
|
2020-04-22 12:31:44 +02:00
|
|
|
linkIcon: 'cloud',
|
|
|
|
authorizedRoles: ['admin']
|
2016-05-09 18:15:04 +02:00
|
|
|
}
|
2018-11-21 11:08:53 +01:00
|
|
|
].concat(Fablab.adminNavLinks);
|
2016-05-10 16:50:01 +02:00
|
|
|
|
2018-11-21 11:08:53 +01:00
|
|
|
$scope.adminNavLinks = adminNavLinks;
|
2017-02-15 15:41:25 +01:00
|
|
|
|
2020-09-23 10:13:41 +02:00
|
|
|
if ($scope.$root.modules.spaces) {
|
2020-06-17 12:20:51 +02:00
|
|
|
$scope.adminNavLinks.splice(3, 0, {
|
2018-10-25 16:50:16 +02:00
|
|
|
state: 'app.public.spaces_list',
|
2019-12-16 16:54:40 +01:00
|
|
|
linkText: 'app.public.common.manage_the_spaces',
|
2017-02-15 15:41:25 +01:00
|
|
|
linkIcon: 'rocket'
|
2018-11-21 11:08:53 +01:00
|
|
|
});
|
2018-10-25 16:50:16 +02:00
|
|
|
}
|
2020-06-17 12:20:51 +02:00
|
|
|
|
2020-09-23 10:13:41 +02:00
|
|
|
if ($scope.$root.modules.statistics) {
|
|
|
|
$scope.adminNavLinks.splice($scope.$root.modules.spaces ? 9 : 8, 0, {
|
2020-06-17 12:20:51 +02:00
|
|
|
state: 'app.admin.statistics',
|
|
|
|
linkText: 'app.public.common.statistics',
|
|
|
|
linkIcon: 'bar-chart-o',
|
|
|
|
authorizedRoles: ['admin']
|
|
|
|
});
|
|
|
|
}
|
2018-10-25 16:50:16 +02:00
|
|
|
}
|
2018-11-21 11:08:53 +01:00
|
|
|
]);
|