Skip to content

Commit

Permalink
New: Add preview mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Sep 28, 2022
1 parent d8ee610 commit b3315cd
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Configuration/Settings.Neos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ Neos:
fusion:
autoInclude:
'Garagist.Plaintext': true
userInterface:
translation:
autoInclude:
Garagist.Plaintext:
- 'Main'
editPreviewModes:
plaintext:
isEditingMode: false
isPreviewMode: true
fusionRenderingPath: 'plaintext'
title: 'Garagist.Plaintext:Main:editPreviewMode'
width: 1024
backgroundColor: '#eee'
Fusion:
defaultContext:
'Garagist.Plaintext': 'Garagist\Plaintext\Eel\PlaintextHelper'
Expand Down
15 changes: 15 additions & 0 deletions Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,18 @@ root {
}
@cache.entryIdentifier.plaintext = ${request.arguments.plaintext ? 'plaintext' : 'default'}
}

plaintext = Neos.Fusion:Case {
canRender {
condition = Neos.Fusion:CanRender {
type = ${node.nodeType.name + '.Plaintext'}
}
type = ${node.nodeType.name + '.Plaintext'}
}
notSet {
condition = true
renderer = Carbon.Notification:Document {
content = ${Translation.translate('editPreviewMode.noSet', 'Plaintext output is not configured for this page type', [], 'Main', 'Garagist.Plaintext')}
}
}
}
16 changes: 16 additions & 0 deletions Resources/Private/Translations/de/Main.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2"
xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="" product-name="Garagist.Plaintext" source-language="en" target-language="de" datatype="plaintext">
<body>
<trans-unit id="editPreviewMode" xml:space="preserve">
<source>Plaintext</source>
<target>Klartext</target>
</trans-unit>
<trans-unit id="editPreviewMode.noSet" xml:space="preserve">
<source>Plaintext output is not configured for this page type</source>
<target>Für diesen Seitentyp ist keine Klartextausgabe konfiguriert</target>
</trans-unit>
</body>
</file>
</xliff>
14 changes: 14 additions & 0 deletions Resources/Private/Translations/en/Main.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2"
xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="" product-name="Garagist.Plaintext" source-language="en" datatype="plaintext">
<body>
<trans-unit id="editPreviewMode" xml:space="preserve">
<source>Plaintext</source>
</trans-unit>
<trans-unit id="editPreviewMode.noSet" xml:space="preserve">
<source>Plaintext output is not configured for this page type</source>
</trans-unit>
</body>
</file>
</xliff>
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "GPL-3.0-or-later",
"require": {
"neos/neos": "^7.3 || ^8.0",
"ext-mbstring": "*"
"ext-mbstring": "*",
"carbon/notification": "^2.4"
},
"authors": [
{
Expand Down

0 comments on commit b3315cd

Please # to comment.