modeladmin - fix issue where action button class conflicted (#6387)

- It was creating styling issues in the wagtailadmin when list export was enabled
- ensure that all actions are contained within the actionbutton div
pull/8175/head
Josh Woodcock 2020-09-17 09:06:37 +01:00 zatwierdzone przez LB Johnston
rodzic bb2c826cbc
commit 8a4a6b4ced
4 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ Changelog
* Convert various pages in the documentation to Markdown (Daniel Kirkham)
* Add `base_url_path` to `ModelAdmin` so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)
* Add `full_url` to the API output of `ImageRenditionField` (Paarth Agarwal)
* Fix issue where `ModelAdmin` index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock)
3.0 (xx.xx.xxxx) - IN DEVELOPMENT

Wyświetl plik

@ -595,6 +595,7 @@ Contributors
* Luz Paz
* Simon Krull
* Przemysław Buczkowski
* Josh Woodcock
Translators
===========

Wyświetl plik

@ -18,7 +18,7 @@ depth: 1
### Bug fixes
* ...
* Fix issue where `ModelAdmin` index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock)
## Upgrade considerations

Wyświetl plik

@ -33,18 +33,20 @@
</div>
{% block header_extra %}
<div class="right header-right">
{% if user_can_create %}
{% if view.list_export or user_can_create %}
<div class="actionbutton">
{% include 'modeladmin/includes/button.html' with button=view.button_helper.add_button %}
</div>
{% endif %}
{% if view.list_export %}
<div class="dropdown dropdown-button match-width col">
<a href="?export=xlsx&{{ request.GET.urlencode }}" class="button bicolor button--icon">{% icon name="download" wrapped=1 %}{% trans 'Download XLSX' %}</a>
<div class="dropdown-toggle">{% icon name="arrow-down" %}</div>
<ul>
<li><a class="button bicolor button--icon" href="?export=csv&{{ request.GET.urlencode }}">{% icon name="download" wrapped=1 %}{% trans 'Download CSV' %}</a></li>
</ul>
{% if user_can_create %}
{% include 'modeladmin/includes/button.html' with button=view.button_helper.add_button %}
{% endif %}
{% if view.list_export %}
<div class="dropdown dropdown-button match-width col">
<a href="?export=xlsx&{{ request.GET.urlencode }}" class="button bicolor button--icon">{% icon name="download" wrapped=1 %}{% trans 'Download XLSX' %}</a>
<div class="dropdown-toggle">{% icon name="arrow-down" %}</div>
<ul>
<li><a class="button bicolor button--icon" href="?export=csv&{{ request.GET.urlencode }}">{% icon name="download" wrapped=1 %}{% trans 'Download CSV' %}</a></li>
</ul>
</div>
{% endif %}
</div>
{% endif %}
</div>