Disable editing when page lock turned on

This commit is contained in:
Edd Baldry 2016-10-29 19:53:06 +01:00 committed by Matt Westcott
parent 6fda0dc01f
commit cb268c233a
5 changed files with 19 additions and 3 deletions

View file

@ -22,6 +22,7 @@ Changelog
* Added `above_login`, `below_login`, `fields` and `login_form` customisation blocks to the login page template (Tim Heap)
* `ChoiceBlock` now accepts a callable as the choices list (Mikalai Radchuk)
* Redundant action buttons are now omitted from the root page in the explorer (Nick Smith)
* Locked pages are now disabled from editing at the browser level (Edd Baldry)
* Fix: `AbstractForm` now respects custom `get_template` methods on the page model (Gagaro)
* Fix: Use specific page model for the parent page in the explore index (Gagaro)
* Fix: Remove responsive styles in embed when there is no ratio available (Gagaro)

View file

@ -188,6 +188,7 @@ Contributors
* Morgan Aubert
* Diederik van der Boor
* Sean Hoefler
* Edd Baldry
Translators
===========

View file

@ -53,6 +53,7 @@ Minor features
* Added ``above_login``, ``below_login``, ``fields`` and ``login_form`` customisation blocks to the login page template - see :doc:`/advanced_topics/customisation/admin_templates` (Tim Heap)
* ``ChoiceBlock`` now accepts a callable as the choices list (Mikalai Radchuk)
* Redundant action buttons are now omitted from the root page in the explorer (Nick Smith)
* Locked pages are now disabled from editing at the browser level (Edd Baldry)
Bug fixes

View file

@ -117,6 +117,18 @@ body {
position: relative; // yuk. necessary for positions for jquery ui widgets
}
.page-locked {
.tab-content {
cursor: not-allowed;
user-select: none;
> * {
pointer-events: none;
}
}
}
footer {
// @include transition(all 0.2s ease);
@include transition(bottom 0.5s ease 1s);
@ -141,13 +153,13 @@ footer {
.actions {
width: 250px;
margin-right: $grid-gutter-width/2;
margin-right: $grid-gutter-width / 2;
}
.meta {
float: right;
text-align: right;
padding: 7px $grid-gutter-width/2;
padding: 7px $grid-gutter-width / 2;
font-size: 0.85em;
p {

View file

@ -3,7 +3,7 @@
{% load gravatar %}
{% load i18n %}
{% block titletag %}{% blocktrans with title=page.get_admin_display_title page_type=content_type.model_class.get_verbose_name %}Editing {{ page_type }}: {{ title }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}page-editor {% if page.live %}page-is-live{% endif %} model-{{ content_type.model }}{% endblock %}
{% block bodyclass %}page-editor {% if page.live %}page-is-live{% endif %} model-{{ content_type.model }} {% if page.locked %}page-locked{% endif %}{% endblock %}
{% block content %}
{% page_permissions page as page_perms %}
@ -26,6 +26,7 @@
<form id="page-edit-form" action="{% url 'wagtailadmin_pages:edit' page.id %}" method="POST" novalidate{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
{{ edit_handler.render_form_content }}