kopia lustrzana https://github.com/wagtail/wagtail
Merge d141c63ab5
into 196cb02d10
commit
4138cecbcf
|
@ -24,7 +24,7 @@ exports[`wagtail.contrib.typed_table_block.blocks.TypedTableBlock it renders cor
|
|||
<div class="typed-table-block__wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th><input type="hidden" name="mytable-column-0-type" value="test_block_a"><input type="hidden" name="mytable-column-0-order" value="0"><button type="button" class="button button-secondary button-small button--icon text-replace prepend-column" aria-label="Insert column" title="Insert column">
|
||||
<tr><th aria-hidden="true"></th><th><input type="hidden" name="mytable-column-0-type" value="test_block_a"><input type="hidden" name="mytable-column-0-order" value="0"><button type="button" class="button button-secondary button-small button--icon text-replace prepend-column" aria-label="Insert column" title="Insert column">
|
||||
<svg class="icon icon-plus icon" aria-hidden="true"><use href="#icon-plus"></use></svg>
|
||||
</button><input type="text" name="mytable-column-0-heading" class="column-heading" placeholder="Column heading"><button type="button" class="button button-secondary button-small button--icon text-replace no delete-column" aria-label="Delete column" title="Delete column">
|
||||
<svg class="icon icon-bin icon" aria-hidden="true"><use href="#icon-bin"></use></svg>
|
||||
|
@ -130,7 +130,7 @@ exports[`wagtail.contrib.typed_table_block.blocks.TypedTableBlock setError passe
|
|||
<div class="typed-table-block__wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th><input type="hidden" name="mytable-column-0-type" value="test_block_a"><input type="hidden" name="mytable-column-0-order" value="0"><button type="button" class="button button-secondary button-small button--icon text-replace prepend-column" aria-label="Insert column" title="Insert column">
|
||||
<tr><th aria-hidden="true"></th><th><input type="hidden" name="mytable-column-0-type" value="test_block_a"><input type="hidden" name="mytable-column-0-order" value="0"><button type="button" class="button button-secondary button-small button--icon text-replace prepend-column" aria-label="Insert column" title="Insert column">
|
||||
<svg class="icon icon-plus icon" aria-hidden="true"><use href="#icon-plus"></use></svg>
|
||||
</button><input type="text" name="mytable-column-0-heading" class="column-heading" placeholder="Column heading"><button type="button" class="button button-secondary button-small button--icon text-replace no delete-column" aria-label="Delete column" title="Delete column">
|
||||
<svg class="icon icon-bin icon" aria-hidden="true"><use href="#icon-bin"></use></svg>
|
||||
|
@ -236,7 +236,7 @@ exports[`wagtail.contrib.typed_table_block.blocks.TypedTableBlock setError shows
|
|||
<div class="typed-table-block__wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th><input type="hidden" name="mytable-column-0-type" value="test_block_a"><input type="hidden" name="mytable-column-0-order" value="0"><button type="button" class="button button-secondary button-small button--icon text-replace prepend-column" aria-label="Insert column" title="Insert column">
|
||||
<tr><th aria-hidden="true"></th><th><input type="hidden" name="mytable-column-0-type" value="test_block_a"><input type="hidden" name="mytable-column-0-order" value="0"><button type="button" class="button button-secondary button-small button--icon text-replace prepend-column" aria-label="Insert column" title="Insert column">
|
||||
<svg class="icon icon-plus icon" aria-hidden="true"><use href="#icon-plus"></use></svg>
|
||||
</button><input type="text" name="mytable-column-0-heading" class="column-heading" placeholder="Column heading"><button type="button" class="button button-secondary button-small button--icon text-replace no delete-column" aria-label="Delete column" title="Delete column">
|
||||
<svg class="icon icon-bin icon" aria-hidden="true"><use href="#icon-bin"></use></svg>
|
||||
|
|
|
@ -76,7 +76,7 @@ export class TypedTableBlock {
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th aria-hidden="true"></th>
|
||||
<th class="control-cell">
|
||||
<button type="button" class="button button-small button-secondary append-column" data-append-column>
|
||||
${h(strings.ADD_COLUMN)}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% for codename, short_label, long_label in formset.permission_types %}
|
||||
<th title="{{ long_label }}">{{ short_label }}</th>
|
||||
{% endfor %}
|
||||
<th></th>
|
||||
<th aria-hidden="true">{% comment "" %} added for visual alignment only {% endcomment %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="id_{{ formset.prefix }}-FORMS">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Page" %}</th>
|
||||
<th></th>
|
||||
<th aria-hidden="true">{% comment "" %} added for visual alignment only {% endcomment %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="id_{{ formset.prefix }}-FORMS">
|
||||
|
|
|
@ -343,3 +343,22 @@ class TestLocking(WagtailTestUtils, TestCase):
|
|||
self.assertFalse(page.locked)
|
||||
self.assertIsNone(page.locked_by)
|
||||
self.assertIsNone(page.locked_at)
|
||||
|
||||
def test_unlock_page_skip_validation_errors(self):
|
||||
# Lock the page
|
||||
self.child_page.locked = True
|
||||
self.child_page.locked_by = self.user
|
||||
self.child_page.locked_at = timezone.now()
|
||||
self.child_page.title = 100
|
||||
# Does not raise ValidationError
|
||||
response = self.client.post(
|
||||
reverse("wagtailadmin_pages:unlock", args=(self.child_page.id,))
|
||||
)
|
||||
self.assertRedirects(
|
||||
response,
|
||||
reverse("wagtailadmin_explore", args=(self.root_page.id,)),
|
||||
)
|
||||
page = Page.objects.get(id=self.child_page.id)
|
||||
self.assertFalse(page.locked)
|
||||
self.assertIsNone(page.locked_by)
|
||||
self.assertIsNone(page.locked_at)
|
||||
|
|
|
@ -92,7 +92,7 @@ class NavigateToChildrenColumn(BaseColumn):
|
|||
return context
|
||||
|
||||
def render_header_html(self, parent_context):
|
||||
return mark_safe("<th></th>")
|
||||
return mark_safe("<th aria-hidden='true'></th>")
|
||||
|
||||
|
||||
class PageTable(Table):
|
||||
|
|
|
@ -29,7 +29,7 @@ class UnlockView(BaseOperationView):
|
|||
self.object.locked = False
|
||||
self.object.locked_by = None
|
||||
self.object.locked_at = None
|
||||
self.object.save(update_fields=["locked", "locked_by", "locked_at"])
|
||||
self.object.save(False, update_fields=["locked", "locked_by", "locked_at"])
|
||||
log(instance=self.object, action="wagtail.unlock", user=self.request.user)
|
||||
|
||||
def get_success_message(self):
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th></th>
|
||||
<th aria-hidden="true">{% comment %} added for visual alignment only {% endcomment %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{% for identifier, short_label, long_label in formset.permission_types %}
|
||||
<th title="{{ long_label }}">{{ short_label }}</th>
|
||||
{% endfor %}
|
||||
<th></th>
|
||||
<th aria-hidden="true">{% comment %} added for visual alignment only {% endcomment %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="id_{{ formset.prefix }}-FORMS">
|
||||
|
|
Ładowanie…
Reference in New Issue