mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
for #268, this adds actions_on_bottom for the default view
This commit is contained in:
parent
e66175ed21
commit
876cc2c723
4 changed files with 12 additions and 6 deletions
|
|
@ -4,6 +4,7 @@ MODEL_ADMIN_ATTRS = (
|
|||
'list_display', 'list_display_links', 'list_filter', 'admin',
|
||||
'search_fields',
|
||||
'index_view', 'detail_view', 'create_view', 'update_view', 'delete_view',
|
||||
'get_default_view_kwargs', 'get_list_actions')
|
||||
'get_default_view_kwargs', 'get_list_actions',
|
||||
'actions_on_bottom',)
|
||||
|
||||
ADMIN2_THEME_DIRECTORY = getattr(settings, "ADMIN2_THEME_DIRECTORY", "djadmin2/bootstrap")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
{% load i18n %}
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-small" type="submit" name="_addanother">{% trans "Save and add another" %}</button>
|
||||
<button class="btn btn-small" type="submit" name="_continue">{% trans "Save and continue editing" %}</button>
|
||||
<button class="btn btn-small btn-success" type="submit" name="_save">{% trans "Save" %}</button>
|
||||
</div>
|
||||
|
|
@ -73,12 +73,10 @@
|
|||
{% 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" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-small" type="submit" name="_addanother">{% trans "Save and add another" %}</button>
|
||||
<button class="btn btn-small" type="submit" name="_continue">{% trans "Save and continue editing" %}</button>
|
||||
<button class="btn btn-small btn-success" type="submit" name="_save">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class ModelAdmin2(object):
|
|||
verbose_name = None
|
||||
verbose_name_plural = None
|
||||
model_admin_attributes = settings.MODEL_ADMIN_ATTRS
|
||||
actions_on_bottom = True
|
||||
|
||||
search_fields = []
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue