0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Add back buttons to page delete / unpublish confirmation pages

Fixes #2213
This commit is contained in:
Matt Westcott 2016-07-07 16:42:04 +01:00 committed by Mikalai Radchuk
parent be1e1927c5
commit 64aac99d97
2 changed files with 10 additions and 5 deletions

View File

@ -17,14 +17,18 @@
{% endblocktrans %}
{% endif %}
</p>
{% page_permissions page as page_perms %}
{% if page_perms.can_unpublish %}
<p>{% trans "Alternatively you can unpublish the page. This removes the page from public view and you can edit or publish it again later." %}</p>
{% endif %}
<form action="{% url 'wagtailadmin_pages:delete' page.id %}" method="POST">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
<input type="submit" value="{% trans 'Delete it' %}" class="button serious {% if page.live %}button-secondary{% endif %}"> {% if page_perms.can_unpublish %}<a href="{% url 'wagtailadmin_pages:unpublish' page.id %}" class="button">{% trans 'Unpublish it' %}</a>{% endif %}
<input type="submit" value="{% trans 'Yes, delete it' %}" class="button serious">
<a href="{% if next %}{{ next }}{% else %}{% url 'wagtailadmin_explore' page.get_parent.id %}{% endif %}" class="button button-secondary">{% trans "No, don't delete it" %}</a>
</form>
{% page_permissions page as page_perms %}
{% if page_perms.can_unpublish %}
{% url 'wagtailadmin_pages:unpublish' page.id as unpublish_url %}
<p style="margin-top: 1em">{% blocktrans %}Alternatively you can <a href="{{ unpublish_url }}">unpublish the page</a>. This removes the page from public view and you can edit or publish it again later.{% endblocktrans %}</p>
{% endif %}
</div>
{% endblock %}

View File

@ -11,6 +11,7 @@
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
<input type="submit" value="{% trans 'Yes, unpublish it' %}" class="button">
<a href="{% if next %}{{ next }}{% else %}{% url 'wagtailadmin_explore' page.get_parent.id %}{% endif %}" class="button button-secondary">{% trans "No, don't unpublish" %}</a>
</form>
</div>
{% endblock %}