mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
admin: docgen admin
This commit is contained in:
parent
be27df1fd5
commit
cb1bbe940f
@ -68,7 +68,7 @@ class AdminDocGeneratorTemplateController extends CRUDController
|
|||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||||
|
|
||||||
return $this->render('ChillDocGeneratorBundle:Admin/DocGeneratorTemplate:pick-context.html.twig', [
|
return $this->render('@ChillDocGenerator/DocGeneratorTemplate/pick-context.html.twig', [
|
||||||
'contexts' => $this->contextManager->getContexts(),
|
'contexts' => $this->contextManager->getContexts(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -56,16 +56,16 @@ class ChillDocGeneratorExtension extends Extension implements PrependExtensionIn
|
|||||||
'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class,
|
'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class,
|
||||||
'actions' => [
|
'actions' => [
|
||||||
'index' => [
|
'index' => [
|
||||||
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/index.html.twig',
|
'template' => '@ChillDocGenerator/DocGeneratorTemplate/index.html.twig',
|
||||||
'role' => 'ROLE_ADMIN',
|
'role' => 'ROLE_ADMIN',
|
||||||
],
|
],
|
||||||
'new' => [
|
'new' => [
|
||||||
'role' => 'ROLE_ADMIN',
|
'role' => 'ROLE_ADMIN',
|
||||||
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/new.html.twig',
|
'template' => '@ChillDocGenerator/DocGeneratorTemplate/new.html.twig',
|
||||||
],
|
],
|
||||||
'edit' => [
|
'edit' => [
|
||||||
'role' => 'ROLE_ADMIN',
|
'role' => 'ROLE_ADMIN',
|
||||||
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/edit.html.twig',
|
'template' => '@ChillDocGenerator/DocGeneratorTemplate/edit.html.twig',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -33,19 +33,18 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if ($this->security->isGranted('ROLE_ADMIN')) {
|
if ($this->security->isGranted('ROLE_ADMIN')) {
|
||||||
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
|
|
||||||
$menu->addChild($this->translator->trans('docgen.Document generation'), [
|
$menu->addChild($this->translator->trans('docgen.Document generation'), [
|
||||||
'route' => 'chill_crud_docgen_template_index',
|
'route' => 'chill_crud_docgen_template_index',
|
||||||
])->setExtras([
|
])->setExtras([
|
||||||
'order' => 350,
|
'order' => 4020,
|
||||||
'explain' => 'docgen.Manage templates and document generation',
|
'explain' => 'docgen.Manage templates and document generation',
|
||||||
]);
|
]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return ['admin_index', 'admin_section', 'docgen_admin'];
|
return ['admin_section', 'admin_docstore'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
|
||||||
|
|
||||||
{% block vertical_menu_content %}
|
|
||||||
{% endblock %}
|
|
@ -1,8 +1,8 @@
|
|||||||
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %}
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
{% block title 'docgen.Edit template'|trans %}
|
{% block title 'docgen.Edit template'|trans %}
|
||||||
|
|
||||||
{% block layout_wvm_content %}
|
{% block admin_content %}
|
||||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||||
|
|
||||||
{% block crud_content_header %}
|
{% block crud_content_header %}
|
@ -1,6 +1,6 @@
|
|||||||
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %}
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
{% block layout_wvm_content %}
|
{% block admin_content %}
|
||||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||||
{% block table_entities_thead_tr %}
|
{% block table_entities_thead_tr %}
|
||||||
<th></th>
|
<th></th>
|
||||||
@ -34,5 +34,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block actions_before %}
|
||||||
|
<li class='cancel'>
|
||||||
|
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||||
|
</li>
|
||||||
|
{% endblock %}
|
||||||
{% endembed %}
|
{% endembed %}
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -1,8 +1,8 @@
|
|||||||
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %}
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
{% block title 'docgen.New template'|trans %}
|
{% block title 'docgen.New template'|trans %}
|
||||||
|
|
||||||
{% block layout_wvm_content %}
|
{% block admin_content %}
|
||||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||||
|
|
||||||
{% block crud_content_header %}
|
{% block crud_content_header %}
|
@ -1,8 +1,8 @@
|
|||||||
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %}
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
{% block title 'docgen.Pick template context'|trans %}
|
{% block title 'docgen.Pick template context'|trans %}
|
||||||
|
|
||||||
{% block layout_wvm_content %}
|
{% block admin_content %}
|
||||||
<div class="col-md-10 col-xxl">
|
<div class="col-md-10 col-xxl">
|
||||||
|
|
||||||
<h1>{{ block('title') }}</h1>
|
<h1>{{ block('title') }}</h1>
|
@ -8,7 +8,7 @@ docgen:
|
|||||||
New template: Nouveau modèle
|
New template: Nouveau modèle
|
||||||
Edit template: Modifier modèle
|
Edit template: Modifier modèle
|
||||||
test generate: Tester la génération
|
test generate: Tester la génération
|
||||||
With context: 'Avec le contexte :'
|
With context %name%: 'Avec le contexte "%name%"'
|
||||||
|
|
||||||
|
|
||||||
crud:
|
crud:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user