浏览代码

Tweak action buttons in the list

Thomas Rabaix 11 年之前
父节点
当前提交
7cf8bdb52b

+ 4 - 0
CHANGELOG.md

@@ -1,6 +1,10 @@
 CHANGELOG
 =========
 
+### 2013-09-23
+
+* change list's action buttons to use ``btn-small`` from twitter bootstrap
+
 ### 2013-09-20
 
 * [BC BREAK] added ``getTranslator``, ``getForm``, ``getBreadcrumbs``

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

@@ -172,9 +172,9 @@ file that was distributed with this source code.
                     <a class="btn" href="{{ admin.generateUrl('list', {filters: 'reset'}) }}">{{ 'link_reset_filter'|trans({}, 'SonataAdminBundle') }}</a>
                 </div>
 
-                {% for paramKey, paramValue in admin.persistentParameters %}
-                    <input type="hidden" name="{{ paramKey }}" value="{{ paramValue }}" />
-                {% endfor %}
+                {#{% for paramKey, paramValue in admin.persistentParameters %}#}
+                    {#<input type="hidden" name="{{ paramKey }}" value="{{ paramValue }}" />#}
+                {#{% endfor %}#}
             </fieldset>
         </form>
     {% endif %}

+ 5 - 3
Resources/views/CRUD/list__action.html.twig

@@ -12,7 +12,9 @@ file that was distributed with this source code.
 {% extends admin.getTemplate('base_list_field') %}
 
 {% block field %}
-    {% for actions in field_description.options.actions %}
-        {% include actions.template %}
-    {% endfor %}
+    <div class="btn-group">
+        {% for actions in field_description.options.actions %}
+            {% include actions.template %}
+        {% endfor %}
+    </div>
 {% endblock %}

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

@@ -10,7 +10,7 @@ file that was distributed with this source code.
 #}
 
 {% if admin.isGranted('DELETE', object) and admin.hasRoute('delete') %}
-    <a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn delete_link" title="{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}">
+    <a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn delete_link btn-small" title="{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}">
         <i class="icon-remove"></i>
         {{ 'action_delete'|trans({}, 'SonataAdminBundle') }}
     </a>

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

@@ -10,7 +10,7 @@ file that was distributed with this source code.
 #}
 
 {% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
-    <a href="{{ admin.generateObjectUrl('edit', object) }}" class="btn edit_link" title="{{ 'action_edit'|trans({}, 'SonataAdminBundle') }}">
+    <a href="{{ admin.generateObjectUrl('edit', object) }}" class="btn edit_link btn-small" title="{{ 'action_edit'|trans({}, 'SonataAdminBundle') }}">
         <i class="icon-edit"></i>
         {{ 'action_edit'|trans({}, 'SonataAdminBundle') }}
     </a>

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

@@ -10,7 +10,7 @@ file that was distributed with this source code.
 #}
 
 {% if admin.hasRoute('show') %}
-    <a href="{{ admin.generateObjectUrl('show', object) }}" class="btn view_link" title="{{ 'action_show'|trans({}, 'SonataAdminBundle') }}">
+    <a href="{{ admin.generateObjectUrl('show', object) }}" class="btn view_link btn-small" title="{{ 'action_show'|trans({}, 'SonataAdminBundle') }}">
         <i class="icon-zoom-in"></i>
         {{ 'action_show'|trans({}, 'SonataAdminBundle') }}
     </a>