From 0ecfcae98b72b8d2701007f3cd61a21e88f08a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Sep 2015 17:18:29 +0200 Subject: [PATCH] fix layout and menu for activity configuration close #614 1h00 --- Controller/AdminController.php | 38 +++++++++++++++++++ Resources/config/routing.yml | 21 ++++++++++ Resources/config/routing/activityreason.yml | 2 +- .../config/routing/activityreasoncategory.yml | 2 +- Resources/config/routing/activitytype.yml | 2 +- Resources/translations/messages.fr.xlf | 11 ------ Resources/translations/messages.fr.yml | 21 +++++++++- Resources/views/ActivityReason/edit.html.twig | 14 ++++--- .../views/ActivityReason/index.html.twig | 22 +++++------ Resources/views/ActivityReason/new.html.twig | 13 +++++-- Resources/views/ActivityReason/show.html.twig | 25 ++++++------ .../ActivityReasonCategory/edit.html.twig | 2 +- .../ActivityReasonCategory/index.html.twig | 2 +- .../ActivityReasonCategory/new.html.twig | 2 +- .../ActivityReasonCategory/show.html.twig | 2 +- Resources/views/ActivityType/edit.html.twig | 2 +- Resources/views/ActivityType/index.html.twig | 2 +- Resources/views/ActivityType/new.html.twig | 2 +- Resources/views/ActivityType/show.html.twig | 2 +- .../views/Admin/layout_activity.html.twig | 31 +++++++++++++++ Resources/views/Admin/menu_activity.html.twig | 20 ++++++++++ 21 files changed, 180 insertions(+), 58 deletions(-) create mode 100644 Controller/AdminController.php delete mode 100644 Resources/translations/messages.fr.xlf create mode 100644 Resources/views/Admin/layout_activity.html.twig create mode 100644 Resources/views/Admin/menu_activity.html.twig diff --git a/Controller/AdminController.php b/Controller/AdminController.php new file mode 100644 index 000000000..bf543ae0a --- /dev/null +++ b/Controller/AdminController.php @@ -0,0 +1,38 @@ + + * + * 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 . + */ + +namespace Chill\ActivityBundle\Controller; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +/** + * Controller for activity configuration + * + * @author Julien Fastré + * @author Champs Libres + */ +class AdminController extends Controller +{ + public function indexActivityAction() + { + return $this->render('ChillActivityBundle:Admin:layout_activity.html.twig'); + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 0f18ae49f..5eaf6124a 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -13,3 +13,24 @@ chill_activity_activityreasoncategory: chill_activity_activitytype: resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml" prefix: / + +chill_admin_activity_index: + path: /{_locale}/admin/activity + defaults: { _controller: ChillActivityBundle:Admin:indexActivity } + options: + menus: + admin: + label: Activity configuration + order: 2000 + +chill_admin_activity_back_to_admin: + path: /{_locale}/admin/activity_back_to_main + defaults: + _controller: FrameworkBundle:Redirect:urlRedirect + path: /{_locale}/admin + permanent: true + options: + menus: + admin_activity: + order: 0 + label: Main admin menu diff --git a/Resources/config/routing/activityreason.yml b/Resources/config/routing/activityreason.yml index 18e0003c6..497cf81c0 100644 --- a/Resources/config/routing/activityreason.yml +++ b/Resources/config/routing/activityreason.yml @@ -3,7 +3,7 @@ chill_activity_activityreason: defaults: { _controller: "ChillActivityBundle:ActivityReason:index" } options: menus: - admin: + admin_activity: order: 2000 label: "Activity Reasons" diff --git a/Resources/config/routing/activityreasoncategory.yml b/Resources/config/routing/activityreasoncategory.yml index 717f6d352..7053f6721 100644 --- a/Resources/config/routing/activityreasoncategory.yml +++ b/Resources/config/routing/activityreasoncategory.yml @@ -3,7 +3,7 @@ chill_activity_activityreasoncategory: defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" } options: menus: - admin: + admin_activity: order: 2010 label: "Activity Reasons Category" diff --git a/Resources/config/routing/activitytype.yml b/Resources/config/routing/activitytype.yml index 621be8bdc..3a73151a3 100644 --- a/Resources/config/routing/activitytype.yml +++ b/Resources/config/routing/activitytype.yml @@ -3,7 +3,7 @@ chill_activity_activitytype: defaults: { _controller: "ChillActivityBundle:ActivityType:index" } options: menus: - admin: + admin_activity: order: 2020 label: "Activity Types" diff --git a/Resources/translations/messages.fr.xlf b/Resources/translations/messages.fr.xlf deleted file mode 100644 index fd59e6c16..000000000 --- a/Resources/translations/messages.fr.xlf +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Symfony2 is great - J'aime Symfony2 - - - - diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 9fc56b438..549b6564c 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -32,7 +32,24 @@ Reset form: Remise à zéro du formulaire 'Success : activity updated!': Bravo ! L'activité a été mise à jour. 'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour. -# CONTROLLER +# ROLES CHILL_ACTIVITY_CREATE: Créer une activité CHILL_ACTIVITY_UPDATE: Modifier une activité -CHILL_ACTIVITY_SEE: Voir une activité \ No newline at end of file +CHILL_ACTIVITY_SEE: Voir une activité + +# admin +Activity configuration menu: Configuration des activités +Activity Types: Types d'activité +Activity Reasons: Sujets d'une activité +Activity Reasons Category: Catégories d'activités + +# activity reason admin +ActivityReason list: Liste des sujets +Create a new activity reason: Créer un nouveau sujet +Active: Actif +Category: Catégorie +ActivityReason creation: Nouveau sujet +ActivityReason edit: Modification d'un sujet +ActivityReason: Sujet d'activité +The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé +The entity is active and will be proposed: Le sujet est actif et sera proposé diff --git a/Resources/views/ActivityReason/edit.html.twig b/Resources/views/ActivityReason/edit.html.twig index cf775fb30..d7f8e782f 100644 --- a/Resources/views/ActivityReason/edit.html.twig +++ b/Resources/views/ActivityReason/edit.html.twig @@ -14,19 +14,23 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

ActivityReason edit

+

{{ 'ActivityReason edit'|trans }}

- {{ form(edit_form) }} + {{ form_start(edit_form) }} + {{ form_row(edit_form.name) }} + {{ form_row(edit_form.active) }} + {{ form_row(edit_form.category) }} + {{ form_row(edit_form.submit, { 'attr': { 'class' : 'sc-button orange' } } ) }} + {{ form_end(edit_form) }} {% endblock %} diff --git a/Resources/views/ActivityReason/index.html.twig b/Resources/views/ActivityReason/index.html.twig index 97915def3..fbee5efcf 100644 --- a/Resources/views/ActivityReason/index.html.twig +++ b/Resources/views/ActivityReason/index.html.twig @@ -14,33 +14,29 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

ActivityReason list

+

{{ 'ActivityReason list'|trans }}

- - - - + + {% for entity in entities %} - - - - + + @@ -52,7 +48,7 @@ diff --git a/Resources/views/ActivityReason/new.html.twig b/Resources/views/ActivityReason/new.html.twig index afc45a5df..e033ec6c0 100644 --- a/Resources/views/ActivityReason/new.html.twig +++ b/Resources/views/ActivityReason/new.html.twig @@ -14,17 +14,22 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

ActivityReason creation

+

{{ 'ActivityReason creation'|trans }}

- {{ form(form) }} + {{ form_start(form) }} + {{ form_row(form.name) }} + {{ form_row(form.active) }} + {{ form_row(form.category) }} + {{ form_row(form.submit, { 'attr': { 'class' : 'sc-button green' } } ) }} + {{ form_end(form) }} diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig index 9aea54df2..830fd466e 100644 --- a/Resources/views/ActivityReason/show.html.twig +++ b/Resources/views/ActivityReason/show.html.twig @@ -14,24 +14,26 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

ActivityReason

+

{{ 'ActivityReason'|trans }}

IdNameActiveActions{{ 'Name'|trans }}{{ 'Actions'|trans }}
{{ entity.id }}{{ entity.name|localize_translatable_string }}{{ entity.active }}
{{ entity.name|localize_translatable_string }}
- - - - - + - - + +
Id{{ entity.id }}
Name{{ 'Name'|trans }} {{ entity.name|localize_translatable_string }}
Active{{ entity.active }}{{ 'Active' }} + {% if entity.active %} +

{{ 'The entity is active and will be proposed'|trans }}

+ {% else %} +

{{ "The entity is inactive and won't be proposed"|trans }}

+ {% endif %} +
@@ -39,14 +41,13 @@ {% endblock %} diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/Resources/views/ActivityReasonCategory/edit.html.twig index 09b81b375..edc630cdb 100644 --- a/Resources/views/ActivityReasonCategory/edit.html.twig +++ b/Resources/views/ActivityReasonCategory/edit.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityReasonCategory edit

diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index b33b5a1d2..afbd867cd 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityReasonCategory list

diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/Resources/views/ActivityReasonCategory/new.html.twig index d4eb215f7..4e4c348da 100644 --- a/Resources/views/ActivityReasonCategory/new.html.twig +++ b/Resources/views/ActivityReasonCategory/new.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityReasonCategory creation

diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index 617543a91..a7fe9fa3a 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityReasonCategory

diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig index 67fdd3b1c..6d6d7660b 100644 --- a/Resources/views/ActivityType/edit.html.twig +++ b/Resources/views/ActivityType/edit.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityType edit

diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index 68b3556e1..5ade83943 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityType list

diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig index 8417bdafd..3310cd011 100644 --- a/Resources/views/ActivityType/new.html.twig +++ b/Resources/views/ActivityType/new.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityType creation

diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig index 6899df806..9d100684d 100644 --- a/Resources/views/ActivityType/show.html.twig +++ b/Resources/views/ActivityType/show.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

ActivityType

diff --git a/Resources/views/Admin/layout_activity.html.twig b/Resources/views/Admin/layout_activity.html.twig new file mode 100644 index 000000000..6392d751a --- /dev/null +++ b/Resources/views/Admin/layout_activity.html.twig @@ -0,0 +1,31 @@ +{# + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + / + * + * 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 . +#} + +{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_activity', { + 'layout': 'ChillActivityBundle::Admin/menu_activity.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block admin_content %} +

{{ 'Activity configuration' |trans }}

+ {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/Resources/views/Admin/menu_activity.html.twig b/Resources/views/Admin/menu_activity.html.twig new file mode 100644 index 000000000..2e00763bb --- /dev/null +++ b/Resources/views/Admin/menu_activity.html.twig @@ -0,0 +1,20 @@ +{# + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + / + * + * 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 . +#} + +{% extends "ChillMainBundle::Menu/verticalMenu.html.twig" %} +{% block v_menu_title %}{{ 'Activity configuration menu'|trans }}{% endblock %} \ No newline at end of file