From b1be75b6b6f7b8915a51c9bdd6d6e53c41a150ce Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Wed, 28 Sep 2022 14:07:34 +0200 Subject: [PATCH] New: Add document notification --- README.md | 17 +++++++++++------ .../Private/Fusion/Components/Document.fusion | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 Resources/Private/Fusion/Components/Document.fusion diff --git a/README.md b/README.md index 19b390b..62ff1ad 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,20 @@ This package provides a tiny fusion helper for notifications: -Type `info` +Type `info` ![screenshot info] -Type `warning` +Type `warning` ![screenshot warning] -Type `alert` +Type `alert` ![screenshot alert] -Type `success` +Type `success` ![screenshot success] Besides these four types, there is also the type `backend`, which on a document, -which is in the colors of the Neos Backend, is ideal for a notification. +which is in the colors of the Neos Backend, is ideal for a notification. ![screenshot backend] ## [Carbon.Notification:Tag] @@ -41,7 +41,7 @@ and website languages differ from each other. ## [Carbon.Notification:Backend] -A variant from `Carbon.Notification:Tag`. +A variant from `Carbon.Notification:Tag`. This notification gets only shown in the backend. Great for NodeTypes, who need input in the inspector. It has the same capabilities as [Carbon.Notification:Tag], it is just extended with `@if.inBackend = ${node.context.inBackend}` @@ -57,6 +57,10 @@ the message is shown, otherwise, it will be hidden. This is done with the CSS se A use-case for this if you want to show a notification if a content collection is empty. +## [Carbon.Notification:Document] + +This sourounds `Carbon.Notification:Tag` with the needed `HTML` Markup for a document. + ## Customization Every notification load the default styles from the settings `Carbon.Notification.default`. If you @@ -96,6 +100,7 @@ package is now installed correctly. [subscription]: https://github.com/CarbonPackages/Carbon.Notification/subscription [carbon.notification:tag]: Resources/Private/Fusion/Components/Tag.fusion [carbon.notification:backend]: Resources/Private/Fusion/Components/Backend.fusion +[carbon.notification:document]: Resources/Private/Fusion/Components/Document.fusion [carbon.notification:data]: Resources/Private/Fusion/Components/Data.fusion [`settings.carbon.yaml`]: Configuration/Settings.Carbon.yaml [screenshot alert]: https://user-images.githubusercontent.com/4510166/77485453-7bedff00-6e2d-11ea-9795-97aab52ded6d.png diff --git a/Resources/Private/Fusion/Components/Document.fusion b/Resources/Private/Fusion/Components/Document.fusion new file mode 100644 index 0000000..12d9f4b --- /dev/null +++ b/Resources/Private/Fusion/Components/Document.fusion @@ -0,0 +1,19 @@ +prototype(Carbon.Notification:Document) < prototype(Neos.Fusion:Component) { + lang = null + title = null + + renderer = Neos.Fusion:Http.Message { + httpResponseHead.headers.'Content-Type' = 'text/html' + doctype = '' + content = afx` + + + {props.title} + + + + + + ` + } +}