Add back buttons to page delete / unpublish confirmation pages

Fixes #2213
pull/2838/head
Matt Westcott 2016-07-07 16:42:04 +01:00 zatwierdzone przez Mikalai Radchuk
rodzic be1e1927c5
commit 64aac99d97
2 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -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 %}

Wyświetl plik

@ -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 %}