From 9b2eee6dedd11ba070cc82a42a6306f24d8e0c27 Mon Sep 17 00:00:00 2001 From: Rob de Kort Date: Mon, 10 Feb 2025 09:24:15 +0100 Subject: [PATCH] Re-use notification partial for form error handling --- .../components/_notification.antlers.html | 33 +++++++++++-------- .../views/page_builder/_form.antlers.html | 5 +-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/export/resources/views/components/_notification.antlers.html b/export/resources/views/components/_notification.antlers.html index 73e1362e..b5888f13 100644 --- a/export/resources/views/components/_notification.antlers.html +++ b/export/resources/views/components/_notification.antlers.html @@ -1,8 +1,8 @@ {{# @name Notification @desc The notification component. Currently used in `resources/views/page_builder/_form.antlers.html`. - @param* content The notification content. @param* type The type of notification: `success`, `notice`, or `error`. + @param content The notification content. @param class Add custom CSS classes. #}} @@ -18,6 +18,7 @@ )}} {{ class }} " + {{ slot:attributes }} >
@@ -37,19 +38,23 @@ }}
-

- {{ content }} -

+ {{ if content }} +

+ {{ content }} +

+ {{ /if }} + + {{ slot }}
diff --git a/export/resources/views/page_builder/_form.antlers.html b/export/resources/views/page_builder/_form.antlers.html index 04b5c4bd..3cfcd2fa 100644 --- a/export/resources/views/page_builder/_form.antlers.html +++ b/export/resources/views/page_builder/_form.antlers.html @@ -17,7 +17,8 @@
{{# Error notifications. #}} {{# Success notifications. #}}