mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-05-05 14:04:48 +00:00
This is DJANGO-ADMIN! fix #300
This commit is contained in:
parent
35b1125429
commit
506f58f705
4 changed files with 26 additions and 8 deletions
|
|
@ -8,6 +8,7 @@ MODEL_ADMIN_ATTRS = (
|
|||
'search_fields',
|
||||
'index_view', 'detail_view', 'create_view', 'update_view', 'delete_view',
|
||||
'get_default_view_kwargs', 'get_list_actions',
|
||||
'actions_on_bottom',)
|
||||
'actions_on_bottom', 'actions_on_top',
|
||||
'save_on_top', 'save_on_bottom')
|
||||
|
||||
ADMIN2_THEME_DIRECTORY = getattr(settings, "ADMIN2_THEME_DIRECTORY", "djadmin2/bootstrap")
|
||||
|
|
|
|||
|
|
@ -38,6 +38,18 @@
|
|||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<form method="post">
|
||||
|
||||
{% if view.model_admin.save_on_bottom %}
|
||||
{# TODO - fix the format of the HTML #}
|
||||
<hr />
|
||||
{% if object %}
|
||||
<a class="btn btn-small btn-danger" href="{% url view|admin2_urlname:'delete' pk=object.pk %}">{% trans "Delete" %}</a>
|
||||
{% endif %}
|
||||
{% include "djadmin2/bootstrap/includes/save_buttons.html" %}
|
||||
<hr />
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
||||
|
|
@ -71,12 +83,12 @@
|
|||
</table>
|
||||
{% endfor %}
|
||||
|
||||
<hr/>
|
||||
{% if object %}
|
||||
<a class="btn btn-small btn-danger" href="{% url view|admin2_urlname:'delete' pk=object.pk %}">{% trans "Delete" %}</a>
|
||||
{% endif %}
|
||||
{% if view.model_admin.actions_on_bottom %}
|
||||
{% include "djadmin2/bootstrap/includes/action_buttons.html" %}
|
||||
{% if view.model_admin.save_on_bottom %}
|
||||
<hr/>
|
||||
{% if object %}
|
||||
<a class="btn btn-small btn-danger" href="{% url view|admin2_urlname:'delete' pk=object.pk %}">{% trans "Delete" %}</a>
|
||||
{% endif %}
|
||||
{% include "djadmin2/bootstrap/includes/save_buttons.html" %}
|
||||
{% endif %}
|
||||
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@ class ModelAdmin2(object):
|
|||
verbose_name = None
|
||||
verbose_name_plural = None
|
||||
model_admin_attributes = settings.MODEL_ADMIN_ATTRS
|
||||
actions_on_bottom = True
|
||||
save_on_top = False
|
||||
save_on_bottom = True
|
||||
|
||||
# Not yet implemented. See #267 and #268
|
||||
actions_on_bottom = False
|
||||
actions_on_top = True
|
||||
|
||||
search_fields = []
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue