Browse Source

Hide the sidebar area if no menu is defined

Thomas Rabaix 13 years ago
parent
commit
8a3729df86
2 changed files with 18 additions and 12 deletions
  1. 12 0
      Resources/public/css/layout.css
  2. 6 12
      Resources/views/standard_layout.html.twig

+ 12 - 0
Resources/public/css/layout.css

@@ -1,3 +1,11 @@
+body {
+    padding-top: 60px;
+}
+
+body.sonata-ba-no-side-menu div.container-fluid > div.content {
+    margin-left: 0px;
+}
+
 table.sonata-ba-list {
     width: 500px;
 }
@@ -99,4 +107,8 @@ em.sonata-ba-field-help {
     display: block;
     color: #999;
     margin-bottom: 10px;
+}
+
+fieldset legend {
+    padding-left: 0px;
 }

+ 6 - 12
Resources/views/standard_layout.html.twig

@@ -27,16 +27,6 @@ file that was distributed with this source code.
 
             <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/bootstrap/bootstrap.min.css') }}" type="text/css" media="all" >
 
-            <style type="text/css">
-              body {
-                  padding-top: 60px;
-              }
-
-              fieldset legend {
-                  padding-left: 0px;
-              }
-            </style>
-
             <!-- 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">
@@ -78,7 +68,7 @@ file that was distributed with this source code.
             {% endif%}
         </title>
     </head>
-    <body>
+    <body class="{% if _side_menu is empty %}sonata-ba-no-side-menu{% endif %}">
         {# initialize block value #}
 
         <div class="topbar" data-dropdown="dropdown" >
@@ -191,7 +181,11 @@ file that was distributed with this source code.
                     </div>
                 {% endif %}
 
-                {% block footer %}{% endblock %}
+                {% block footer %}
+                    <div style="float: right; clear: both">
+                        <span class="label"><a href="http://sonata-project.org" style="text-decoration: none; color: black">Sonata Project</a></span>
+                    </div>
+                {% endblock %}
             </div>
         </div>
     </body>