From b09d92eae8f9fdf50843e7c162f593d3436b0349 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 May 2022 08:03:20 +0200 Subject: [PATCH] admin: reorganise files according to conventions --- .../ChillMainExtension.php | 30 ++++++------ .../views/Admin/Location/edit.html.twig | 39 ---------------- .../views/Admin/Location/new.html.twig | 39 ---------------- .../views/Admin/LocationType/edit.html.twig | 14 ------ .../views/Admin/LocationType/new.html.twig | 11 ----- .../views/{Admin => }/Civility/edit.html.twig | 8 +++- .../{Admin => }/Civility/index.html.twig | 17 ++++--- .../Language => Civility}/new.html.twig | 8 +++- .../Language => Country}/edit.html.twig | 8 +++- .../views/{Admin => }/Country/index.html.twig | 17 +++++-- .../views/{Admin => }/Country/new.html.twig | 8 +++- .../Country => Language}/edit.html.twig | 8 +++- .../{Admin => }/Language/index.html.twig | 2 +- .../Civility => Language}/new.html.twig | 8 +++- .../Resources/views/Location/edit.html.twig | 39 ++++++++++++++++ .../{Admin => }/Location/index.html.twig | 45 ++++++++---------- .../Resources/views/Location/new.html.twig | 39 ++++++++++++++++ .../views/LocationType/edit.html.twig | 11 +++++ .../{Admin => }/LocationType/index.html.twig | 46 ++++++++----------- .../views/LocationType/new.html.twig | 11 +++++ .../MenuBuilder/AdminSectionMenuBuilder.php | 4 +- .../ChillMainBundle/translations/admin.fr.yml | 4 -- .../translations/messages.fr.yml | 11 ++++- 23 files changed, 225 insertions(+), 202 deletions(-) delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Civility/edit.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Civility/index.html.twig (77%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Language => Civility}/new.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Language => Country}/edit.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Country/index.html.twig (71%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Country/new.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Country => Language}/edit.html.twig (57%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Language/index.html.twig (96%) rename src/Bundle/ChillMainBundle/Resources/views/{Admin/Civility => Language}/new.html.twig (57%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Location/edit.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/Location/index.html.twig (57%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Location/new.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/LocationType/edit.html.twig rename src/Bundle/ChillMainBundle/Resources/views/{Admin => }/LocationType/index.html.twig (60%) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/LocationType/new.html.twig delete mode 100644 src/Bundle/ChillMainBundle/translations/admin.fr.yml diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 43d85f052..0c974b637 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -357,15 +357,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Location/index.html.twig', + 'template' => '@ChillMain/Location/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Location/new.html.twig', + 'template' => '@ChillMain/Location/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Location/edit.html.twig', + 'template' => '@ChillMain/Location/edit.html.twig', ], ], ], @@ -379,15 +379,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/LocationType/index.html.twig', + 'template' => '@ChillMain/LocationType/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/LocationType/new.html.twig', + 'template' => '@ChillMain/LocationType/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/LocationType/edit.html.twig', + 'template' => '@ChillMain/LocationType/edit.html.twig', ], ], ], @@ -401,15 +401,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/index.html.twig', + 'template' => '@ChillMain/Country/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/new.html.twig', + 'template' => '@ChillMain/Country/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Country/edit.html.twig', + 'template' => '@ChillMain/Country/edit.html.twig', ], ], ], @@ -423,15 +423,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Civility/index.html.twig', + 'template' => '@ChillMain/Civility/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Civility/new.html.twig', + 'template' => '@ChillMain/Civility/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Civility/edit.html.twig', + 'template' => '@ChillMain/Civility/edit.html.twig', ], ], ], @@ -445,15 +445,15 @@ class ChillMainExtension extends Extension implements 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/index.html.twig', + 'template' => '@ChillMain/Language/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/new.html.twig', + 'template' => '@ChillMain/Language/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillMain/Admin/Language/edit.html.twig', + 'template' => '@ChillMain/Language/edit.html.twig', ], ], ], diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig deleted file mode 100644 index d34d6968f..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/edit.html.twig +++ /dev/null @@ -1,39 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - - {% block crud_content_form_rows %} - - {{ form_row(form.locationType) }} - -
- {{ form_row(form.address) }} -
- - {{ form_row(form.name) }} - -
- {{ form_row(form.phonenumber1) }} - {{ form_row(form.phonenumber2) }} - {{ form_row(form.email) }} -
- - {% endblock crud_content_form_rows %} - - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} - -{% block js %} - {{ encore_entry_script_tags('mod_input_address') }} - {{ encore_entry_script_tags('page_location') }} -{% endblock %} - -{% block css %} - {{ encore_entry_link_tags('mod_input_address') }} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig deleted file mode 100644 index ba25a05e0..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Location/new.html.twig +++ /dev/null @@ -1,39 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - - {% block crud_content_form_rows %} - - {{ form_row(form.locationType) }} - -
- {{ form_row(form.address) }} -
- - {{ form_row(form.name) }} - -
- {{ form_row(form.phonenumber1) }} - {{ form_row(form.phonenumber2) }} - {{ form_row(form.email) }} -
- - {% endblock crud_content_form_rows %} - - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} - -{% block js %} - {{ encore_entry_script_tags('mod_input_address') }} - {{ encore_entry_script_tags('page_location') }} -{% endblock %} - -{% block css %} - {{ encore_entry_link_tags('mod_input_address') }} -{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig deleted file mode 100644 index ad0a38f73..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/edit.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_edit_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{# {% as we are in the admin layout, we override the admin content with the CRUD content %} #} -{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {# we do not have "view" page. We empty the corresponding block #} - {% block content_form_actions_view %}{% endblock %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig deleted file mode 100644 index 0781272a1..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/LocationType/new.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Civility/edit.html.twig similarity index 57% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Civility/edit.html.twig index 1160220a3..4d55c480c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Civility/edit.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} -{% block content -%} +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} -{% endblock content %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Civility/index.html.twig similarity index 77% rename from src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Civility/index.html.twig index 9d28d3339..60a9c0c63 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Civility/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Civility/index.html.twig @@ -1,14 +1,13 @@ {% extends '@ChillMain/CRUD/Admin/index.html.twig' %} - {% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} id - name - abbreviation - active - ordering + {{ 'name'|trans }} + {{ 'abbreviation'|trans }} + {{ 'active'|trans }} + {{ 'ordering'|trans }} {% endblock %} {% block table_entities_tbody %} @@ -17,7 +16,13 @@ {{ entity.id }} {{ entity.name|localize_translatable_string }} {{ entity.abbreviation|localize_translatable_string }} - {{ entity.active }} + + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + {{ entity.order }}