Browse Source

Fixing styles on admin with subclasses (#4356)

Jordi Sala Morales 8 years ago
parent
commit
54119cf324

+ 6 - 3
Resources/views/Button/acl_button.html.twig

@@ -9,7 +9,10 @@ file that was distributed with this source code.
 
 #}
 {% if admin.isAclEnabled() and admin.canAccessObject('acl', object) and admin.hasRoute('acl') %}
-    <a class="sonata-action-element" href="{{ admin.generateObjectUrl('acl', object) }}">
-        <i class="fa fa-users" aria-hidden="true"></i>
-        {{ 'link_action_acl'|trans({}, 'SonataAdminBundle') }}</a>
+    <li>
+        <a class="sonata-action-element" href="{{ admin.generateObjectUrl('acl', object) }}">
+            <i class="fa fa-users" aria-hidden="true"></i>
+            {{ 'link_action_acl'|trans({}, 'SonataAdminBundle') }}
+        </a>
+    </li>
 {% endif %}

+ 14 - 13
Resources/views/Button/create_button.html.twig

@@ -11,19 +11,20 @@ file that was distributed with this source code.
 
 {% if admin.hasAccess('create') and admin.hasRoute('create') %}
     {% if admin.subClasses is empty %}
-        <a class="sonata-action-element" href="{{ admin.generateUrl('create') }}">
-            <i class="fa fa-plus-circle" aria-hidden="true"></i>
-            {{ 'link_action_create'|trans({}, 'SonataAdminBundle') }}</a>
+        <li>
+            <a class="sonata-action-element" href="{{ admin.generateUrl('create') }}">
+                <i class="fa fa-plus-circle" aria-hidden="true"></i>
+                {{ 'link_action_create'|trans({}, 'SonataAdminBundle') }}
+            </a>
+        </li>
     {% else %}
-        <ul class="list-unstyled">
-            {% for subclass in admin.subclasses|keys %}
-                <li>
-                    <a href="{{ admin.generateUrl('create', {'subclass': subclass}) }}">
-                        <i class="fa fa-plus-circle" aria-hidden="true"></i>
-                        {{ 'link_action_create'|trans({}, 'SonataAdminBundle') }} {{ subclass|trans({}, admin.translationdomain) }}
-                    </a>
-                </li>
-            {% endfor %}
-        </ul>
+        {% for subclass in admin.subclasses|keys %}
+            <li>
+                <a class="sonata-action-element" href="{{ admin.generateUrl('create', {'subclass': subclass}) }}">
+                    <i class="fa fa-plus-circle" aria-hidden="true"></i>
+                    {{ 'link_action_create'|trans({}, 'SonataAdminBundle') }} {{ subclass|trans({}, admin.translationdomain) }}
+                </a>
+            </li>
+        {% endfor %}
     {% endif %}
 {% endif %}

+ 6 - 3
Resources/views/Button/edit_button.html.twig

@@ -10,7 +10,10 @@ file that was distributed with this source code.
 #}
 
 {% if admin.canAccessObject('edit', object) and admin.hasRoute('edit') %}
-    <a class="sonata-action-element" href="{{ admin.generateObjectUrl('edit', object) }}">
-        <i class="fa fa-edit" aria-hidden="true"></i>
-        {{ 'link_action_edit'|trans({}, 'SonataAdminBundle') }}</a>
+    <li>
+        <a class="sonata-action-element" href="{{ admin.generateObjectUrl('edit', object) }}">
+            <i class="fa fa-edit" aria-hidden="true"></i>
+            {{ 'link_action_edit'|trans({}, 'SonataAdminBundle') }}
+        </a>
+    </li>
 {% endif %}

+ 6 - 3
Resources/views/Button/history_button.html.twig

@@ -10,7 +10,10 @@ file that was distributed with this source code.
 #}
 
 {% if admin.canAccessObject('history', object) and admin.hasRoute('history') %}
-    <a class="sonata-action-element" href="{{ admin.generateObjectUrl('history', object) }}">
-        <i class="fa fa-archive" aria-hidden="true"></i>
-        {{ 'link_action_history'|trans({}, 'SonataAdminBundle') }}</a>
+    <li>
+        <a class="sonata-action-element" href="{{ admin.generateObjectUrl('history', object) }}">
+            <i class="fa fa-archive" aria-hidden="true"></i>
+            {{ 'link_action_history'|trans({}, 'SonataAdminBundle') }}
+        </a>
+    </li>
 {% endif %}

+ 6 - 3
Resources/views/Button/list_button.html.twig

@@ -10,7 +10,10 @@ file that was distributed with this source code.
 #}
 
 {% if admin.hasAccess('list') and admin.hasRoute('list') %}
-    <a class="sonata-action-element" href="{{ admin.generateUrl('list') }}">
-        <i class="fa fa-list" aria-hidden="true"></i>
-        {{ 'link_action_list'|trans({}, 'SonataAdminBundle') }}</a>
+    <li>
+        <a class="sonata-action-element" href="{{ admin.generateUrl('list') }}">
+            <i class="fa fa-list" aria-hidden="true"></i>
+            {{ 'link_action_list'|trans({}, 'SonataAdminBundle') }}
+        </a>
+    </li>
 {% endif %}

+ 6 - 3
Resources/views/Button/show_button.html.twig

@@ -9,7 +9,10 @@ file that was distributed with this source code.
 
 #}
 {% if admin.canAccessObject('show', object) and admin.show|length > 0 and admin.hasRoute('show') %}
-    <a class="sonata-action-element" href="{{ admin.generateObjectUrl('show', object) }}">
-        <i class="fa fa-eye" aria-hidden="true"></i>
-        {{ 'link_action_show'|trans({}, 'SonataAdminBundle') }}</a>
+    <li>
+        <a class="sonata-action-element" href="{{ admin.generateObjectUrl('show', object) }}">
+            <i class="fa fa-eye" aria-hidden="true"></i>
+            {{ 'link_action_show'|trans({}, 'SonataAdminBundle') }}
+        </a>
+    </li>
 {% endif %}

+ 1 - 1
Resources/views/CRUD/action_buttons.html.twig

@@ -11,7 +11,7 @@ file that was distributed with this source code.
 {% spaceless %}
     {% for item in admin.getActionButtons(action, object|default(null)) %}
         {% if item.template is defined %}
-            <li>{% include item.template %}</li>
+            {% include item.template %}
         {% endif %}
     {% endfor %}
 {% endspaceless %}

+ 3 - 1
Resources/views/CRUD/base_list.html.twig

@@ -22,7 +22,7 @@ file that was distributed with this source code.
         The list template can be used in nested mode,
         so we define the title corresponding to the parent's admin.
     #}
-    
+
     {% if admin.isChild and admin.parent.subject %}
         {{ "title_edit"|trans({'%name%': admin.parent.toString(admin.parent.subject)|truncate(15) }, 'SonataAdminBundle') }}
     {% endif %}
@@ -106,7 +106,9 @@ file that was distributed with this source code.
                                 </div>
                                 <span class="progress-description">
                                     {% if not app.request.xmlHttpRequest %}
+                                    <ul class="list-unstyled">
                                         {% include 'SonataAdminBundle:Button:create_button.html.twig' %}
+                                    </ul>
                                     {% endif %}
                                 </span>
                             </div><!-- /.info-box-content -->