diff --git a/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css b/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css index f93a91d..3011d14 100644 --- a/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css +++ b/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css @@ -82,6 +82,7 @@ textarea { border-radius: 5px;*/ } + .save_btns { margin-top: 10px; border: 1px solid #CCCCC1; diff --git a/djadmin2/templates/djadmin2/bootstrap/model_update_form.html b/djadmin2/templates/djadmin2/bootstrap/model_update_form.html index bc3b7ae..26fc4bc 100644 --- a/djadmin2/templates/djadmin2/bootstrap/model_update_form.html +++ b/djadmin2/templates/djadmin2/bootstrap/model_update_form.html @@ -40,24 +40,25 @@ {% block content %} -
-
{% if view.model_admin.save_on_top %} -
- - {% if object %} - - - {% trans "Delete" %} - - {% endif %} - {% include "djadmin2/bootstrap/includes/save_buttons.html" %} - +
+
+ {% if object %} + + + {% trans "Delete" %} + + {% endif %} + {% include "djadmin2/bootstrap/includes/save_buttons.html" %} +
{% endif %} +
+
+
{% csrf_token %} {{ form|crispy }} @@ -104,22 +105,25 @@ {% endfor %} + +
+
{% if view.model_admin.save_on_bottom %} -
- - {% if object %} - - - {% trans "Delete" %} - - {% endif %} - {% include "djadmin2/bootstrap/includes/save_buttons.html" %} +
+
+ {% if object %} + + + {% trans "Delete" %} + + {% endif %} + {% include "djadmin2/bootstrap/includes/save_buttons.html" %} +
{% endif %} - -
-
+ + {% endblock content %} diff --git a/example/blog/admin2.py b/example/blog/admin2.py index 604b62a..30564ae 100644 --- a/example/blog/admin2.py +++ b/example/blog/admin2.py @@ -33,6 +33,7 @@ class PostAdmin(djadmin2.ModelAdmin2): field_renderers = { 'title': renderers.title_renderer, } + save_on_top = True class CommentAdmin(djadmin2.ModelAdmin2):