Przeglądaj źródła

Revert templates changes, as Twig does not share 'block' to an included file.
(and 'use' only work for a template with extends another file)

Thomas Rabaix 13 lat temu
rodzic
commit
6a75c52335

+ 0 - 14
Resources/views/Core/actions.html.twig

@@ -1,14 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-<div class="right">
-    {% block actions %}{% endblock %}
-</div>

+ 0 - 24
Resources/views/Core/breadcrumb.html.twig

@@ -1,24 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-<div class="sonata-ba-breadcrumbs">
-    <h1>
-    {% block breadcrumb %}
-        {% if action is defined %}
-            {% for label, uri in admin.breadcrumbs(action) %}
-                {% if not loop.first  %}
-                    &gt;
-                {% endif %}
-                <a href="{{ uri }}">{{ label }}</a>
-            {% endfor %}
-        {% endif %}
-    {% endblock %}
-    </h1>
-</div>

+ 0 - 14
Resources/views/Core/footer.html.twig

@@ -1,14 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-<div class="span-24 last">
-    {% block footer %}{% endblock %}
-</div>

+ 0 - 19
Resources/views/Core/head_javascripts.html.twig

@@ -1,19 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-{% block javascripts %}
-    <script src="{{ asset('bundles/sonatajquery/jquery-1.4.4.js') }}" type="text/javascript"></script>
-    <script src="{{ asset('bundles/sonatajquery/jquery-ui-1.8.6.custom.js') }}" type="text/javascript"></script>
-    <script src="{{ asset('bundles/sonatajquery/jquery-ui-i18n.js') }}" type="text/javascript"></script>
-    <script src="{{ asset('bundles/sonataadmin/qtip/jquery.qtip-1.0.0-rc3.min.js') }}" type="text/javascript"></script>
-    <script src="{{ asset('bundles/sonataadmin/jquery/jquery.form.js') }}" type="text/javascript"></script>
-    <script src="{{ asset('bundles/sonataadmin/base.js') }}" type="text/javascript"></script>
-{% endblock %}

+ 0 - 24
Resources/views/Core/head_stylesheets.html.twig

@@ -1,24 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-{% block stylesheets %}
-    <!-- jQuery code -->
-    <link rel="stylesheet" href="{{ asset('bundles/sonatajquery/themes/flick/jquery-ui-1.8.6.custom.css') }}" type="text/css" media="all" />
-
-    <!-- blueprint code -->
-    <link rel="stylesheet" href="{{ asset('bundles/sonatablueprint/screen.css') }}" type="text/css" media="screen, projection">
-    <link rel="stylesheet" href="{{ asset('bundles/sonatablueprint/print.css') }}" type="text/css" media="print">
-    <!--[if lt IE 8]><link rel="stylesheet" href="{{ asset('bundles/sonatablueprint/ie.css') }}" type="text/css" media="screen, projection"><![endif]-->
-
-    <!-- base application asset -->
-    <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/layout.css') }}" type="text/css" media="all">
-    <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/colors.css') }}" type="text/css" media="all">
-{% endblock %}

+ 0 - 24
Resources/views/Core/head_title.html.twig

@@ -1,24 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-<title>
-    {% block title %} {% trans from 'SonataAdminBundle' %}Admin{% endtrans %}
-        {% if action is defined %}
-            -
-            {% for label, uri in admin.breadcrumbs(action) %}
-                {% if not loop.first  %}
-                    &gt;
-                {% endif %}
-                {{ label }}
-            {% endfor %}
-        {% endif %}
-    {% endblock %}
-</title>

+ 0 - 20
Resources/views/Core/header.html.twig

@@ -1,20 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-<div class="span-24 last header">
-    <div class="span-20">
-        <a href="{{ url('sonata_admin_dashboard') }}" class="home">{% trans from 'SonataAdminBundle' %}Admin{% endtrans %}</a>
-    </div>
-
-    <div class="span-4 last">
-        {% block user_panel %}{#Add here logout option / user options#}{% endblock %}
-    </div>
-</div>

+ 0 - 22
Resources/views/Core/notice.html.twig

@@ -1,22 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-{# flash notice defined in CRUDController after actions- 3 levels #}
-{% for notice_level in ['success','error','notice'] %}
-
-    {% set session_var = 'sonata_flash_' ~ notice_level %}
-    {% if app.session.hasFlash(session_var) %}
-        <div class="{{notice_level}}">
-        {{ app.session.flash(session_var) | trans([],'SonataAdminBundle') }}
-       </div>
-    {% endif %}
-
-{% endfor %}

+ 77 - 8
Resources/views/standard_layout.html.twig

@@ -13,9 +13,42 @@ file that was distributed with this source code.
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
-        {% include 'SonataAdminBundle:Core:head_stylesheets.html.twig' %}
-        {% include 'SonataAdminBundle:Core:head_javascripts.html.twig' %}
-        {% include 'SonataAdminBundle:Core:head_title.html.twig' %}
+        {% block stylesheets %}
+            <!-- jQuery code -->
+            <link rel="stylesheet" href="{{ asset('bundles/sonatajquery/themes/flick/jquery-ui-1.8.6.custom.css') }}" type="text/css" media="all" />
+
+            <!-- blueprint code -->
+            <link rel="stylesheet" href="{{ asset('bundles/sonatablueprint/screen.css') }}" type="text/css" media="screen, projection">
+            <link rel="stylesheet" href="{{ asset('bundles/sonatablueprint/print.css') }}" type="text/css" media="print">
+            <!--[if lt IE 8]><link rel="stylesheet" href="{{ asset('bundles/sonatablueprint/ie.css') }}" type="text/css" media="screen, projection"><![endif]-->
+
+            <!-- base application asset -->
+            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/layout.css') }}" type="text/css" media="all">
+            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/colors.css') }}" type="text/css" media="all">
+        {% endblock %}
+
+        {% block javascripts %}
+            <script src="{{ asset('bundles/sonatajquery/jquery-1.4.4.js') }}" type="text/javascript"></script>
+            <script src="{{ asset('bundles/sonatajquery/jquery-ui-1.8.6.custom.js') }}" type="text/javascript"></script>
+            <script src="{{ asset('bundles/sonatajquery/jquery-ui-i18n.js') }}" type="text/javascript"></script>
+            <script src="{{ asset('bundles/sonataadmin/qtip/jquery.qtip-1.0.0-rc3.min.js') }}" type="text/javascript"></script>
+            <script src="{{ asset('bundles/sonataadmin/jquery/jquery.form.js') }}" type="text/javascript"></script>
+            <script src="{{ asset('bundles/sonataadmin/base.js') }}" type="text/javascript"></script>
+        {% endblock %}
+
+        <title>
+            {% block title %} {% trans from 'SonataAdminBundle' %}Admin{% endtrans %}
+                {% if action is defined %}
+                    -
+                    {% for label, uri in admin.breadcrumbs(action) %}
+                        {% if not loop.first  %}
+                            &gt;
+                        {% endif %}
+                        {{ label }}
+                    {% endfor %}
+                {% endif %}
+            {% endblock %}
+        </title>
     </head>
     <body>
         {# initialize block value #}
@@ -30,12 +63,46 @@ file that was distributed with this source code.
             {% set _side_menu    = block('side_menu') %}
             {% set _content      = block('content') %}
 
-            {% include 'SonataAdminBundle:Core:header.html.twig' %}
+            <div class="span-24 last header">
+                <div class="span-20">
+                    <a href="{{ url('sonata_admin_dashboard') }}" class="home">{% trans from 'SonataAdminBundle' %}Admin{% endtrans %}</a>
+                </div>
+
+                <div class="span-4 last">
+                    {% block user_panel %}{#Add here logout option / user options#}{% endblock %}
+                </div>
+            </div>
 
             <div class="span-24 last content clear">
-                {% include 'SonataAdminBundle:Core:actions.html.twig' %}
-                {% include 'SonataAdminBundle:Core:breadcrumb.html.twig' %}
-                {% include 'SonataAdminBundle:Core:notice.html.twig' %}
+                <div class="right">
+                    {% block actions %}{% endblock %}
+                </div>
+
+                <div class="sonata-ba-breadcrumbs">
+                    <h1>
+                        {% block breadcrumb %}
+                            {% if action is defined %}
+                                {% for label, uri in admin.breadcrumbs(action) %}
+                                    {% if not loop.first  %}
+                                        &gt;
+                                    {% endif %}
+                                    <a href="{{ uri }}">{{ label }}</a>
+                                {% endfor %}
+                            {% endif %}
+                        {% endblock %}
+                    </h1>
+                </div>
+
+                {% block notice %}
+                    {% for notice_level in ['success','error','notice'] %}
+                        {% set session_var = 'sonata_flash_' ~ notice_level %}
+                        {% if app.session.hasFlash(session_var) %}
+                            <div class="{{notice_level}}">
+                            {{ app.session.flash(session_var) | trans([],'SonataAdminBundle') }}
+                           </div>
+                        {% endif %}
+                    {% endfor %}
+                {% endblock %}
             </div>
 
             {% if _preview is not empty %}
@@ -93,7 +160,9 @@ file that was distributed with this source code.
 
             </div>
 
-            {% include 'SonataAdminBundle:Core:footer.html.twig' %}
+            <div class="span-24 last">
+                {% block footer %}{% endblock %}
+            </div>
         </div>
     </body>
 </html>