Thomas Rabaix 12 年 前
コミット
54d77ccf97

+ 9 - 2
Resources/public/css/layout.css

@@ -121,8 +121,15 @@ body.sonata-bc {
     color: #000;
 }
 
-.sonata-bc table.sonata-ba-list td {
-    width: 75px;
+.sonata-bc table.sonata-ba-list {
+    font-size: 14px;
+}
+
+.sonata-bc td.sonata-ba-list-label {
+    vertical-align: middle;
+    font-weight: bold;
+    text-align: right;
+    color: #565656;
 }
 
 .sonata-bc .zebra-striped tbody tr.sonata-ba-list-row-selected td, .sonata-bc .zebra-striped tbody tr.sonata-ba-list-row-selected th {

+ 54 - 53
Resources/views/Block/block_admin_list.html.twig

@@ -12,61 +12,62 @@ file that was distributed with this source code.
 {% extends 'SonataBlockBundle:Block:block_base.html.twig' %}
 
 {% block block %}
-    {% for group in groups %}
-        {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
-        {% for role in group.roles if not display %}
-            {% set display = is_granted(role)%}
-        {% endfor %}
 
-        {% if display %}
-            <table class="table table-bordered table-striped sonata-ba-list">
-                <thead>
-                    <tr>
-                        <th colspan="3">{{ group.label|trans({}, group.label_catalogue) }}</th>
-                    </tr>
-                </thead>
+    <table class="table table-condensed sonata-ba-list">
 
-                <tbody>
-                    {% for admin in group.items %}
-                        {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
-                            <tr>
-                                <td class="sonata-ba-list-label">{{ admin.label|trans({}, admin.translationdomain) }}</td>
-                                <td>
-                                    <div class="btn-group">
-                                        {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
-                                            {% if admin.subClasses is empty %}
-                                                <a class="btn btn-small" href="{{ admin.generateUrl('create')}}">
-                                                    <i class="icon-plus"></i>
-                                                    {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
-                                                </a>
-                                            {% else %}
-                                                <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
-                                                    <i class="icon-plus"></i>
-                                                    {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
-                                                    <span class="caret"></span>
-                                                </a>
-                                                <ul class="dropdown-menu">
-                                                    {% for subclass in admin.subclasses|keys %}
-                                                    <li>
-                                                        <a href="{{ admin.generateUrl('create', {'subclass': subclass}) }}">{{ subclass }}</a>
-                                                    </li>
-                                                    {% endfor %}
-                                                </ul>
-                                            {% endif %}
-                                        {% endif %}
-                                        {% if admin.hasroute('list') and admin.isGranted('LIST') %}
-                                            <a class="btn btn-small" href="{{ admin.generateUrl('list')}}">
-                                                <i class="icon-list"></i>
-                                                {% trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
+        {% for group in groups %}
+            {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
+            {% for role in group.roles if not display %}
+                {% set display = is_granted(role)%}
+            {% endfor %}
+
+            {% if display %}
+                <tr>
+                    <td colspan="3" style="background: none repeat scroll 0 0 #F7F7F7;"><strong>{{ group.label|trans({}, group.label_catalogue) }}</strong></td>
+                </tr>
+
+                {% for admin in group.items %}
+                    {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
+                        <tr>
+                            <td class="sonata-ba-list-label">
+                                {{ admin.label|trans({}, admin.translationdomain) }}
+                            </td>
+                            <td>
+                                <div class="btn-group">
+                                    {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
+                                        {% if admin.subClasses is empty %}
+                                            <a class="btn btn-link" href="{{ admin.generateUrl('create')}}">
+                                                <i class="icon-plus"></i>
+                                                {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
                                             </a>
+                                        {% else %}
+                                            <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
+                                                <i class="icon-plus"></i>
+                                                {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
+                                                <span class="caret"></span>
+                                            </a>
+                                            <ul class="dropdown-menu">
+                                                {% for subclass in admin.subclasses|keys %}
+                                                <li>
+                                                    <a href="{{ admin.generateUrl('create', {'subclass': subclass}) }}">{{ subclass }}</a>
+                                                </li>
+                                                {% endfor %}
+                                            </ul>
                                         {% endif %}
-                                    </div>
-                                </td>
-                            </tr>
-                        {% endif %}
-                    {% endfor %}
-                </tbody>
-            </table>
-        {% endif %}
-    {% endfor %}
+                                    {% endif %}
+                                    {% if admin.hasroute('list') and admin.isGranted('LIST') %}
+                                        <a class="btn btn-link" href="{{ admin.generateUrl('list')}}">
+                                            <i class="icon-list"></i>
+                                            {% trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
+                                        </a>
+                                    {% endif %}
+                                </div>
+                            </td>
+                        </tr>
+                    {% endif %}
+                {% endfor %}
+
+            {% endif %}
+        {% endfor %}
+    </table>
 {% endblock %}

+ 1 - 1
Resources/views/Core/dashboard.html.twig

@@ -22,7 +22,7 @@ file that was distributed with this source code.
             {% endif %}
         {% endfor %}
 
-        <div class="{% if has_center %}span4{% else %}span6{% endif %}">
+        <div class="{% if has_center %}span3{% else %}span6{% endif %}">
             {% for block in blocks %}
                 {% if block.position == 'left' %}
                     {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}

+ 10 - 7
Resources/views/standard_layout.html.twig

@@ -17,6 +17,7 @@ file that was distributed with this source code.
 {% set _content      = block('content') %}
 {% set _title        = block('title') %}
 {% set _breadcrumb   = block('breadcrumb') %}
+{% set _actions      = block('actions') %}
 <!DOCTYPE html>
 <html {% block html_attributes %}class="no-js"{% endblock %}>
     <head>
@@ -145,8 +146,8 @@ file that was distributed with this source code.
             {% endblock %}
 
             <div class="row-fluid">
-                <div class="span6">
-                    {% if _breadcrumb is not empty or action is defined %}
+                {% if _breadcrumb is not empty or action is defined %}
+                    <div class="span6">
                         <ul class="breadcrumb">
                             {% if _breadcrumb is empty %}
                                 {% if action is defined %}
@@ -169,12 +170,14 @@ file that was distributed with this source code.
                                 {{ _breadcrumb|raw }}
                             {% endif %}
                         </ul>
-                    {% endif %}
-                </div>
+                    </div>
+                {% endif %}
 
-                <div class="span4 offset2">
-                    {%block actions %}{% endblock %}
-                </div>
+                {% if _actions is not empty %}
+                    <div class="span4 offset2">
+                        {{ _actions|raw }}
+                    </div>
+                {% endif %}
             </div>
 
             <div class="row-fluid">