Browse Source

Do not use FieldRowPanel for scheduled publishing fields

To prevent inconsistent layout if only one of the fields has an error
Sage Abdullah 1 năm trước cách đây
mục cha
commit
994698d76c

+ 0 - 5
client/scss/components/forms/_publishing.scss

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

+ 12 - 16
wagtail/admin/panels/publishing_panel.py

@@ -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",