jdaugherty commented on code in PR #15560:
URL: https://github.com/apache/grails-core/pull/15560#discussion_r3058366415
##########
grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/taglib/ApplicationTagLib.groovy:
##########
@@ -471,4 +471,68 @@ class ApplicationTagLib implements
ApplicationContextAware, InitializingBean, Gr
// encoding is handled in GroovyPage.invokeTag and
GroovyPage.captureTagOutput
body()
}
+
+ /**
+ * Renders flash.message, flash.error, and flash.warning as Bootstrap
alert divs.
+ * Automatically skips rendering if already called during this request,
preventing
+ * duplicate display when used in both pages and layouts.
+ *
+ * @emptyTag
+ *
+ * @attr messageClass CSS class for flash.message alerts (default: 'alert
alert-success alert-dismissible fade show')
+ * @attr messageIcon Icon class for flash.message alerts (default: 'bi
bi-check-circle me-2')
+ * @attr errorClass CSS class for flash.error alerts (default: 'alert
alert-danger alert-dismissible fade show')
+ * @attr errorIcon Icon class for flash.error alerts (default: 'bi
bi-exclamation-triangle me-2')
+ * @attr warningClass CSS class for flash.warning alerts (default: 'alert
alert-warning alert-dismissible fade show')
+ * @attr warningIcon Icon class for flash.warning alerts (default: 'bi
bi-exclamation-circle me-2')
+ * @attr role ARIA role for alert divs (default: 'alert')
+ * @attr dismissible Whether to show a close button (default: true)
+ */
+ Closure flashMessages = { attrs ->
Review Comment:
I'm happy to merge this if we have app level config values for this stuff.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]