diff --git a/Controller/ExportController.php b/Controller/ExportController.php new file mode 100644 index 000000000..af143c3e1 --- /dev/null +++ b/Controller/ExportController.php @@ -0,0 +1,39 @@ + + * + * 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\MainBundle\Controller; + +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +/** + * ExportController is the controller use for exporting data. + * + */ +class ExportController extends Controller +{ + public function indexAction($menu = 'admin', + $header_title = 'views.Main.admin.index.header_title', + $page_title = 'views.Main.admin.index.page_title') + { + return $this->render('ChillMainBundle:Export:layout.html.twig'); + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index e61546ea6..b59abfb66 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -19,16 +19,26 @@ chill_main_homepage: label: Homepage icons: [home] +chill_main_export_index: + pattern: /{_locale}/export + defaults: { _controller: ChillMainBundle:Export:index } + options: + menus: + section: + order: 20 + label: Export Menu + icons: [upload] + chill_main_admin_central: pattern: /{_locale}/admin defaults: { _controller: ChillMainBundle:Admin:index } options: menus: section: - order: 20 + order: 30 label: Admin Menu icons: [gears] - + chill_main_search: pattern: /{_locale}/search defaults: { _controller: ChillMainBundle:Search:search } diff --git a/Resources/views/Admin/layout.html.twig b/Resources/views/Admin/layout.html.twig index 6ef1cf737..2397a7351 100644 --- a/Resources/views/Admin/layout.html.twig +++ b/Resources/views/Admin/layout.html.twig @@ -1,5 +1,6 @@ {# - * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * 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 @@ -14,46 +15,17 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::layout.html.twig" %} -{% block layout_content %} +{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %} -
+{% block vertical_menu_content %} {{ chill_menu('admin', { 'layout': 'ChillMainBundle::Menu/admin.html.twig', }) }} +{% endblock %} -
- {# Flash messages ! #} -
- {% for flashMessage in app.session.flashbag.get('success') %} -
- - {{ flashMessage|raw }} - -
- {% endfor %} - - {% for flashMessage in app.session.flashbag.get('danger') %} -
- - {{ flashMessage|raw }} - -
- {% endfor %} - - {% for flashMessage in app.session.flashbag.get('info') %} -
- - {{ flashMessage|raw }} - -
- {% endfor %} -
- - {% block admin_content %} - Welcome to the Admin ! - {% endblock %} -
-
-{% endblock %} \ No newline at end of file +{% block layout_wvm_content %} + {% block admin_content %} + Welcome to the admin section ! + {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/Resources/views/Export/layout.html.twig b/Resources/views/Export/layout.html.twig new file mode 100644 index 000000000..d8b1d41fb --- /dev/null +++ b/Resources/views/Export/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::layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('export', { + 'layout': 'ChillMainBundle::Menu/export.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block export_content %} + Welcome to the Export section ! + {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/Resources/views/Menu/admin.html.twig b/Resources/views/Menu/admin.html.twig index 91a900aee..dbd6f7be4 100644 --- a/Resources/views/Menu/admin.html.twig +++ b/Resources/views/Menu/admin.html.twig @@ -1,14 +1,20 @@ -
- -
\ No newline at end of file +{# + * 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 %}{{ 'Admin Menu'|trans }}{% endblock %} \ No newline at end of file diff --git a/Resources/views/Menu/export.html.twig b/Resources/views/Menu/export.html.twig new file mode 100644 index 000000000..9280fccf8 --- /dev/null +++ b/Resources/views/Menu/export.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 %}{{ 'Export Menu'|trans }}{% endblock %} \ No newline at end of file diff --git a/Resources/views/Menu/verticalMenu.html.twig b/Resources/views/Menu/verticalMenu.html.twig new file mode 100644 index 000000000..860413137 --- /dev/null +++ b/Resources/views/Menu/verticalMenu.html.twig @@ -0,0 +1,38 @@ +{# + * 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 . +#} + +{# + Layout for a vertical menu (like admin, export) to use with the + layout ../layoutWithVerticalMenu.html.twig. +#} +
+ +
\ No newline at end of file diff --git a/Resources/views/layoutWithVerticalMenu.html.twig b/Resources/views/layoutWithVerticalMenu.html.twig new file mode 100644 index 000000000..0a77ed563 --- /dev/null +++ b/Resources/views/layoutWithVerticalMenu.html.twig @@ -0,0 +1,64 @@ +{# + * 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 . +#} + +{# + Layout with a vertical menu and a conainer for the content (like admin, export) + ( for the vertical menu you can extends Menu/veticalMenu.html.twig ). +#} + +{% extends "ChillMainBundle::layout.html.twig" %} + +{% block layout_content %} + +
+ {% block vertical_menu_content %} + {% endblock %} + +
+ {# Flash messages ! #} +
+ {% for flashMessage in app.session.flashbag.get('success') %} +
+ + {{ flashMessage|raw }} + +
+ {% endfor %} + + {% for flashMessage in app.session.flashbag.get('danger') %} +
+ + {{ flashMessage|raw }} + +
+ {% endfor %} + + {% for flashMessage in app.session.flashbag.get('info') %} +
+ + {{ flashMessage|raw }} + +
+ {% endfor %} +
+ + {% block layout_wvm_content %} + {% endblock %} +
+
+{% endblock %} \ No newline at end of file