1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-02 13:24:20 +01:00
fab-manager/app/assets/javascripts/controllers/main_nav.js

139 lines
3.2 KiB
JavaScript
Raw Normal View History

/* eslint-disable
no-undef,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
'use strict'
2015-05-05 03:10:25 +02:00
/**
* Navigation controller. List the links availables in the left navigation pane and their icon.
*/
Application.Controllers.controller('MainNavController', ['$scope', '$location', '$cookies', function ($scope, $location, $cookies) {
// Common links (public application)
2015-05-05 03:10:25 +02:00
$scope.navLinks = [
{
state: 'app.public.home',
linkText: 'home',
2015-05-05 03:10:25 +02:00
linkIcon: 'home'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.public.machines_list',
linkText: 'reserve_a_machine',
2016-07-18 17:57:50 +02:00
linkIcon: 'cogs'
},
2016-03-23 18:39:41 +01:00
{
state: 'app.public.trainings_list',
linkText: 'trainings_registrations',
2016-03-23 18:39:41 +01:00
linkIcon: 'graduation-cap'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.public.events_list',
linkText: 'events_registrations',
2015-05-05 03:10:25 +02:00
linkIcon: 'tags'
},
{
state: 'app.public.calendar',
linkText: 'public_calendar',
linkIcon: 'calendar'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.public.projects_list',
linkText: 'projects_gallery',
2015-05-05 03:10:25 +02:00
linkIcon: 'th'
}
2016-03-23 18:39:41 +01:00
]
2015-05-05 03:10:25 +02:00
if (!Fablab.withoutPlans) {
2016-03-23 18:39:41 +01:00
$scope.navLinks.push({
state: 'app.public.plans',
linkText: 'subscriptions',
linkIcon: 'credit-card'
})
}
2016-03-23 18:39:41 +01:00
if (!Fablab.withoutSpaces) {
2017-03-01 15:51:13 +01:00
$scope.navLinks.splice(3, 0, {
state: 'app.public.spaces_list',
linkText: 'reserve_a_space',
linkIcon: 'rocket'
})
}
Fablab.adminNavLinks = Fablab.adminNavLinks || []
const adminNavLinks = [
2016-03-23 18:39:41 +01:00
{
state: 'app.admin.trainings',
linkText: 'trainings_monitoring',
2016-03-23 18:39:41 +01:00
linkIcon: 'graduation-cap'
},
2016-03-23 18:39:41 +01:00
{
state: 'app.admin.calendar',
linkText: 'manage_the_calendar',
2016-03-23 18:39:41 +01:00
linkIcon: 'calendar'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.admin.members',
linkText: 'manage_the_users',
2015-05-05 03:10:25 +02:00
linkIcon: 'users'
},
2016-03-23 18:39:41 +01:00
{
state: 'app.admin.invoices',
linkText: 'manage_the_invoices',
2016-03-23 18:39:41 +01:00
linkIcon: 'file-pdf-o'
},
2016-03-23 18:39:41 +01:00
{
state: 'app.admin.pricing',
linkText: 'subscriptions_and_prices',
2016-03-23 18:39:41 +01:00
linkIcon: 'money'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.admin.events',
linkText: 'manage_the_events',
2015-05-05 03:10:25 +02:00
linkIcon: 'tags'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.public.machines_list',
linkText: 'manage_the_machines',
2015-05-05 03:10:25 +02:00
linkIcon: 'cogs'
},
2015-05-05 03:10:25 +02:00
{
state: 'app.admin.project_elements',
linkText: 'manage_the_projects_elements',
2015-05-05 03:10:25 +02:00
linkIcon: 'tasks'
},
2016-03-23 18:39:41 +01:00
{
state: 'app.admin.statistics',
linkText: 'statistics',
2016-03-23 18:39:41 +01:00
linkIcon: 'bar-chart-o'
},
2016-03-23 18:39:41 +01:00
{
state: 'app.admin.settings',
linkText: 'customization',
2016-03-23 18:39:41 +01:00
linkIcon: 'gear'
},
2016-05-09 18:15:04 +02:00
{
state: 'app.admin.open_api_clients',
linkText: 'open_api_clients',
2016-05-09 18:15:04 +02:00
linkIcon: 'cloud'
}
].concat(Fablab.adminNavLinks)
2016-05-10 16:50:01 +02:00
$scope.adminNavLinks = adminNavLinks
if (!Fablab.withoutSpaces) {
return $scope.adminNavLinks.splice(7, 0, {
state: 'app.public.spaces_list',
linkText: 'manage_the_spaces',
linkIcon: 'rocket'
})
}
}
])