diff --git a/Controller/AdminController.php b/Controller/AdminController.php new file mode 100644 index 000000000..c3a419bf2 --- /dev/null +++ b/Controller/AdminController.php @@ -0,0 +1,37 @@ + + * + * 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\EventBundle\Controller; + + +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +/** + * Controller for the event configuration section (in + * the admin) + * + */ +class AdminController extends Controller +{ + public function indexAction() + { + return $this->render('ChillEventBundle:Admin:layout.html.twig'); + } +} \ No newline at end of file diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index c8be2882e..e4e36b796 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -2,7 +2,24 @@ chill_event_event: resource: "@ChillEventBundle/Resources/config/routing/event.yml" prefix: /{_locale}/event/event -chill_event_fr_admin_event_status: +chill_event_participation: + resource: "@ChillEventBundle/Resources/config/routing/participation.yml" + prefix: /{_locale}/event/participation + + +## ADMIN + +chill_event_admin: + path: /{_locale}/admin/event + defaults: { _controller: "ChillEventBundle:Admin:index" } + options: + menus: + admin_section: + order: 1000 + label: "Events configuration" + icons: ['calendar'] + +chill_event_admin_status: resource: "@ChillEventBundle/Resources/config/routing/status.yml" prefix: /{_locale}/admin/event/status @@ -14,6 +31,3 @@ chill_event_admin_event_type: resource: "@ChillEventBundle/Resources/config/routing/eventtype.yml" prefix: /{_locale}/admin/event/event_type -chill_event_participation: - resource: "@ChillEventBundle/Resources/config/routing/participation.yml" - prefix: /{_locale}/event/participation diff --git a/Resources/config/routing/eventtype.yml b/Resources/config/routing/eventtype.yml index 305c27af8..198a17ebc 100644 --- a/Resources/config/routing/eventtype.yml +++ b/Resources/config/routing/eventtype.yml @@ -1,6 +1,11 @@ chill_eventtype_admin: path: / defaults: { _controller: "ChillEventBundle:EventType:index" } + options: + menus: + admin_events: + order: 90 + label: "Event types" chill_eventtype_admin_show: path: /{id}/show diff --git a/Resources/config/routing/role.yml b/Resources/config/routing/role.yml index bfc51216d..52746b104 100644 --- a/Resources/config/routing/role.yml +++ b/Resources/config/routing/role.yml @@ -1,6 +1,11 @@ chill_event_admin_role: path: / defaults: { _controller: "ChillEventBundle:Role:index" } + options: + menus: + admin_events: + order: 110 + label: "Event roles" chill_event_admin_role_show: path: /{id}/show diff --git a/Resources/config/routing/status.yml b/Resources/config/routing/status.yml index 383a704ff..de6c3dbe0 100644 --- a/Resources/config/routing/status.yml +++ b/Resources/config/routing/status.yml @@ -1,6 +1,11 @@ chill_event_admin_status: path: / defaults: { _controller: "ChillEventBundle:Status:index" } + options: + menus: + admin_events: + order: 100 + label: "Event status" chill_event_admin_status_show: path: /{id}/show diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 44e77e20d..b02bf7627 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -73,4 +73,23 @@ Pick a type of event: Choisir un type d'événement Pick a moderator: Choisir un animateur Select a format: Choisir un format -Export: Exporter \ No newline at end of file +Export: Exporter + + +Events configuration: Événements +Events configuration menu: Menu des événements +Event status: Statuts +Event roles: Rôles +Event types: Types d'événements +EventType list: Liste des types d'événements +EventType: Types d'événements +EventType creation: Nouveau type d'événement +EventType edit: Modifier le type d'événement +Status list: Liste des statuts +Status: Statuts +Status creation: Nouveau statut +Status edit: Modifier un statut +Role list: Liste des rôles +Role: Rôles +Role creation: Nouveau rôle +Role edit: Modifier un rôle diff --git a/Resources/views/Admin/layout.html.twig b/Resources/views/Admin/layout.html.twig new file mode 100644 index 000000000..b69a5a449 --- /dev/null +++ b/Resources/views/Admin/layout.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::Admin/layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_events', { + 'layout': 'ChillEventBundle::Admin/menu.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block admin_content %} +

{{ 'Events configuration' |trans }}

+ {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/Resources/views/Admin/menu.html.twig b/Resources/views/Admin/menu.html.twig new file mode 100644 index 000000000..db697c172 --- /dev/null +++ b/Resources/views/Admin/menu.html.twig @@ -0,0 +1,23 @@ +{# + * 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 %} + {{ 'Events configuration menu'|trans }} +{% endblock %} + diff --git a/Resources/views/EventType/edit.html.twig b/Resources/views/EventType/edit.html.twig index 92bf5a236..c6c24b052 100644 --- a/Resources/views/EventType/edit.html.twig +++ b/Resources/views/EventType/edit.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

EventType edit

+{% block admin_content -%} + +

{{ 'EventType edit'|trans }}

{{ form(edit_form) }} diff --git a/Resources/views/EventType/index.html.twig b/Resources/views/EventType/index.html.twig index 669384172..959355878 100644 --- a/Resources/views/EventType/index.html.twig +++ b/Resources/views/EventType/index.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

EventType list

+{% block admin_content -%} + +

{{ 'EventType list'|trans }}

@@ -40,4 +41,4 @@ - {% endblock %} +{% endblock %} diff --git a/Resources/views/EventType/new.html.twig b/Resources/views/EventType/new.html.twig index 69a8f2638..7bf1e07a5 100644 --- a/Resources/views/EventType/new.html.twig +++ b/Resources/views/EventType/new.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

EventType creation

+{% block admin_content -%} + +

{{ 'EventType creation'|trans }}

{{ form(form) }} diff --git a/Resources/views/EventType/show.html.twig b/Resources/views/EventType/show.html.twig index df2712898..cd73d4833 100644 --- a/Resources/views/EventType/show.html.twig +++ b/Resources/views/EventType/show.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

EventType

+{% block admin_content -%} + +

{{ 'EventType'|trans }}

diff --git a/Resources/views/Role/edit.html.twig b/Resources/views/Role/edit.html.twig index 021c810d6..d34538c89 100644 --- a/Resources/views/Role/edit.html.twig +++ b/Resources/views/Role/edit.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

Role edit

+{% block admin_content -%} + +

{{ 'Role edit'|trans }}

{{ form(edit_form) }} diff --git a/Resources/views/Role/index.html.twig b/Resources/views/Role/index.html.twig index 5ac43d05e..3cc10167b 100644 --- a/Resources/views/Role/index.html.twig +++ b/Resources/views/Role/index.html.twig @@ -1,13 +1,15 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

Role list

+{% block admin_content -%} + +

{{ 'Role list'|trans }}

+ @@ -17,6 +19,7 @@ +
Id NameType Active Actions
{{ entity.id }} {{ entity.name|localize_translatable_string }}{{ entity.type.name|localize_translatable_string }} {{ entity.active }}
    diff --git a/Resources/views/Role/new.html.twig b/Resources/views/Role/new.html.twig index fd3c82044..7b58f7c85 100644 --- a/Resources/views/Role/new.html.twig +++ b/Resources/views/Role/new.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

    Role creation

    +{% block admin_content -%} + +

    {{ 'Role creation'|trans }}

    {{ form(form) }} diff --git a/Resources/views/Role/show.html.twig b/Resources/views/Role/show.html.twig index 5a6956e76..bb149bc29 100644 --- a/Resources/views/Role/show.html.twig +++ b/Resources/views/Role/show.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

    Role

    +{% block admin_content -%} + +

    {{ 'Role'|trans }}

    diff --git a/Resources/views/Status/edit.html.twig b/Resources/views/Status/edit.html.twig index 8c610c130..1e80e1115 100644 --- a/Resources/views/Status/edit.html.twig +++ b/Resources/views/Status/edit.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

    Status edit

    +{% block admin_content -%} + +

    {{ 'Status edit'|trans }}

    {{ form(edit_form) }} diff --git a/Resources/views/Status/index.html.twig b/Resources/views/Status/index.html.twig index 1d3854625..e506a7dd2 100644 --- a/Resources/views/Status/index.html.twig +++ b/Resources/views/Status/index.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

    Status list

    +{% block admin_content -%} + +

    {{ 'Status list'|trans }}

    diff --git a/Resources/views/Status/new.html.twig b/Resources/views/Status/new.html.twig index bd2d824fa..307963b9e 100644 --- a/Resources/views/Status/new.html.twig +++ b/Resources/views/Status/new.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

    Status creation

    +{% block admin_content -%} + +

    {{ 'Status creation'|trans }}

    {{ form(form) }} diff --git a/Resources/views/Status/show.html.twig b/Resources/views/Status/show.html.twig index 8aa32d1a2..52931bdd8 100644 --- a/Resources/views/Status/show.html.twig +++ b/Resources/views/Status/show.html.twig @@ -1,7 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillEventBundle:Admin:layout.html.twig" %} -{% block body -%} -

    Status

    +{% block admin_content -%} + +

    {{ 'Status'|trans }}