Improve layout of articles admin save buttons

This commit is contained in:
Gabriel Augendre 2020-12-28 08:21:57 +01:00
parent 8d335282e4
commit 5b2a2f79c8
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 11 additions and 12 deletions

View file

@ -0,0 +1,11 @@
{% extends "admin/submit_line.html" %}
{% load i18n admin_urls %}
{% block submit-row %}
{{ block.super }}
{% if original.status != original.PUBLISHED %}
<input type="submit" value="Save & publish" name="_publish">
{% elif original.status != original.DRAFT %}
<input type="submit" value="Save & unpublish" name="_unpublish">
{% endif %}
<input type="submit" value="Save & preview" name="_preview">
{% endblock %}

View file

@ -1,17 +1,5 @@
{% extends 'admin/change_form.html' %} {% extends 'admin/change_form.html' %}
{% block submit_buttons_bottom %}
{{ block.super }}
<div class="submit-row">
{% if original.status != original.PUBLISHED %}
<input type="submit" value="Save & publish" name="_publish">
{% elif original.status != original.DRAFT %}
<input type="submit" value="Save & unpublish" name="_unpublish">
{% endif %}
<input type="submit" value="Save & preview" name="_preview">
</div>
{% endblock %}
{% block object-tools-items %} {% block object-tools-items %}
<li><a href="https://www.markdownguide.org/cheat-sheet/" class="historylink" target="_blank">Markdown cheat sheet</a></li> <li><a href="https://www.markdownguide.org/cheat-sheet/" class="historylink" target="_blank">Markdown cheat sheet</a></li>
{{ block.super }} {{ block.super }}