mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
admin sections for main bundle
This commit is contained in:
parent
0f735c5749
commit
c9b3bab508
@ -20,7 +20,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_activity', {
|
||||
'layout': '@ChillActivity/Admin/menu_activity.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Activity configuration menu'|trans }}{% endblock %}
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_calendar', {
|
||||
'layout': '@ChillCalendar/Admin/menu_calendar.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Calendar configuration'|trans }}{% endblock %}
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_docstore', {
|
||||
'layout': '@ChillDocStore/Admin/menu.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
{#
|
||||
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
|
||||
<info@champs-libres.coop> / <http://www.champs-libres.coop>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
|
||||
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Documents configuration'|trans }}{% endblock %}
|
||||
|
@ -23,4 +23,28 @@ class AdminController extends AbstractController
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/index.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/user", name="chill_main_user_admin")
|
||||
*/
|
||||
public function indexUserAction()
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexUser.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/language", name="chill_main_language_admin")
|
||||
*/
|
||||
public function indexLanguageAction()
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexLanguage.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/location", name="chill_main_location_admin")
|
||||
*/
|
||||
public function indexLocationAction()
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexLocation.html.twig');
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
|
||||
|
||||
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% endembed %}
|
||||
{% endblock content %}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_language', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Language configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_location', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Location configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_user', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'User configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Routing\MenuBuilder;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminLanguageMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Languages and countries', [
|
||||
'route' => 'chill_main_language_admin',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 1200, 'header' => true]);
|
||||
|
||||
$menu->addChild('Language list', [
|
||||
'route' => 'chill_crud_main_language_index',
|
||||
])->setExtras(['order' => 1210]);
|
||||
|
||||
$menu->addChild('Country list', [
|
||||
'route' => 'chill_crud_main_country_index',
|
||||
])->setExtras(['order' => 1220]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_language'];
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Routing\MenuBuilder;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminLocationMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Location and location type', [
|
||||
'route' => 'chill_main_location_admin',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 1300, 'header' => true]);
|
||||
|
||||
$menu->addChild('Location type list', [
|
||||
'route' => 'chill_crud_main_location_type_index',
|
||||
])->setExtras(['order' => 1310]);
|
||||
|
||||
$menu->addChild('Location list', [
|
||||
'route' => 'chill_crud_main_location_index',
|
||||
])->setExtras(['order' => 1320]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_location'];
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
@ -34,7 +34,9 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Users and permissions')
|
||||
$menu->addChild('Users and permissions', [
|
||||
'route' => 'chill_main_user_admin',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 1000, 'header' => true]);
|
||||
|
||||
@ -57,34 +59,10 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
$menu->addChild('User jobs', [
|
||||
'route' => 'chill_crud_admin_user_job_index',
|
||||
])->setExtras(['order' => 1050]);
|
||||
|
||||
$menu->addChild('Languages and countries')
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 1200, 'header' => true]);
|
||||
|
||||
$menu->addChild('Language list', [
|
||||
'route' => 'chill_crud_main_language_index',
|
||||
])->setExtras(['order' => 1210]);
|
||||
|
||||
$menu->addChild('Country list', [
|
||||
'route' => 'chill_crud_main_country_index',
|
||||
])->setExtras(['order' => 1220]);
|
||||
|
||||
$menu->addChild('Location and location type')
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 1300, 'header' => true]);
|
||||
|
||||
$menu->addChild('Location type list', [
|
||||
'route' => 'chill_crud_main_location_type_index',
|
||||
])->setExtras(['order' => 1310]);
|
||||
|
||||
$menu->addChild('Location list', [
|
||||
'route' => 'chill_crud_main_location_index',
|
||||
])->setExtras(['order' => 1320]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_index'];
|
||||
return ['admin_section', 'admin_user'];
|
||||
}
|
||||
}
|
@ -17,9 +17,3 @@ services:
|
||||
autoconfigure: true
|
||||
tags:
|
||||
- { name: 'chill.menu_builder' }
|
||||
|
||||
Chill\MainBundle\Routing\MenuBuilder\AdminSectionMenuBuilder:
|
||||
arguments:
|
||||
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||
tags:
|
||||
- { name: 'chill.menu_builder' }
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_accompanying_course', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_household', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_person', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_social_work', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Third party configuration'|trans }}{% endblock %}
|
@ -12,12 +12,6 @@ services:
|
||||
# tags:
|
||||
# - { name: 'chill.menu_builder' }
|
||||
#
|
||||
# Chill\PersonBundle\Menu\AdminMenuBuilder:
|
||||
# arguments:
|
||||
# $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||
# tags:
|
||||
# - { name: 'chill.menu_builder' }
|
||||
#
|
||||
Chill\PersonBundle\Menu\PersonMenuBuilder:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_thirdparty', {
|
||||
'layout': '@ChillThirdParty/Admin/menu.html.twig',
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig'
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Third party configuration'|trans }}{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user