0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 05:02:57 +01:00

Do not use FieldRowPanel for scheduled publishing fields

To prevent inconsistent layout if only one of the fields has an error
This commit is contained in:
Sage Abdullah 2023-06-22 10:51:02 +01:00
parent 876b0e0f19
commit 994698d76c
No known key found for this signature in database
GPG Key ID: EB1A33CC51CC0217
2 changed files with 12 additions and 21 deletions

View File

@ -1,10 +1,5 @@
// Styles for the fields in the scheduled publishing dialog
.w-dialog.publishing {
.w-panel__wrapper {
margin-top: theme('spacing.2');
margin-bottom: theme('spacing.2');
}
.w-field--date_time_field input {
width: 100%;
}

View File

@ -5,7 +5,7 @@ from wagtail.admin.widgets.datetime import AdminDateTimeInput
from wagtail.models import Page
from .field_panel import FieldPanel
from .group import FieldRowPanel, MultiFieldPanel
from .group import MultiFieldPanel
# This allows users to include the publishing panel in their own per-model override
@ -16,21 +16,17 @@ class PublishingPanel(MultiFieldPanel):
js_overlay_parent_selector = "#schedule-publishing-dialog"
updated_kwargs = {
"children": [
FieldRowPanel(
[
FieldPanel(
"go_live_at",
widget=AdminDateTimeInput(
js_overlay_parent_selector=js_overlay_parent_selector,
),
),
FieldPanel(
"expire_at",
widget=AdminDateTimeInput(
js_overlay_parent_selector=js_overlay_parent_selector,
),
),
],
FieldPanel(
"go_live_at",
widget=AdminDateTimeInput(
js_overlay_parent_selector=js_overlay_parent_selector,
),
),
FieldPanel(
"expire_at",
widget=AdminDateTimeInput(
js_overlay_parent_selector=js_overlay_parent_selector,
),
),
],
"classname": "publishing",