From bec63446f362bdc5575e04acd41de9812e6469b9 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 21 Nov 2014 17:29:56 +0100 Subject: [PATCH] Improving admin interface --- Controller/AdminController.php | 2 +- Resources/views/Admin/index.html.twig | 13 ------ Resources/views/Admin/layout.html.twig | 59 ++++++++++++++++++++++++++ Resources/views/Menu/admin.html.twig | 19 ++++++--- 4 files changed, 74 insertions(+), 19 deletions(-) delete mode 100644 Resources/views/Admin/index.html.twig create mode 100644 Resources/views/Admin/layout.html.twig diff --git a/Controller/AdminController.php b/Controller/AdminController.php index be97d429e..3a23f2027 100644 --- a/Controller/AdminController.php +++ b/Controller/AdminController.php @@ -16,7 +16,7 @@ class AdminController extends Controller { $page_title = 'views.Main.admin.index.page_title') { - return $this->render('ChillMainBundle:Admin:index.html.twig', array( + return $this->render('ChillMainBundle:Admin:layout.html.twig', array( 'menu_composer' => $this->get('chill.main.menu_composer'), 'menu' => $menu, 'header_title' => $header_title, diff --git a/Resources/views/Admin/index.html.twig b/Resources/views/Admin/index.html.twig deleted file mode 100644 index 8382aaedb..000000000 --- a/Resources/views/Admin/index.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "ChillMainBundle::layout.html.twig" %} - -{% block title%}{{ header_title|trans }}{% endblock %} - -{% block content %} - -

{{ page_title|trans }}

- -{{ chill_menu('admin', { - 'layout': 'ChillMainBundle::Menu/admin.html.twig', -}) }} - -{% endblock %} \ No newline at end of file diff --git a/Resources/views/Admin/layout.html.twig b/Resources/views/Admin/layout.html.twig new file mode 100644 index 000000000..6ef1cf737 --- /dev/null +++ b/Resources/views/Admin/layout.html.twig @@ -0,0 +1,59 @@ +{# + * Copyright (C) 2014, 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::layout.html.twig" %} + +{% block layout_content %} + +
+ {{ chill_menu('admin', { + 'layout': 'ChillMainBundle::Menu/admin.html.twig', + }) }} + +
+ {# 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 diff --git a/Resources/views/Menu/admin.html.twig b/Resources/views/Menu/admin.html.twig index 2b6e630ee..91a900aee 100644 --- a/Resources/views/Menu/admin.html.twig +++ b/Resources/views/Menu/admin.html.twig @@ -1,5 +1,14 @@ - \ No newline at end of file +
+ +
\ No newline at end of file