Skip to content

Commit

Permalink
✨ Add items mixin
Browse files Browse the repository at this point in the history
This mixin is not activated by default
  • Loading branch information
jonnitto committed Aug 26, 2019
1 parent d7d3d80 commit c6df04f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions Configuration/NodeTypes.Container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'Neos.Neos:Content': true
'Neos.Neos:ContentCollection': true
'Jonnitto.ImagesInARow:Mixin.CreationDialog.Assets': true
# 'Jonnitto.ImagesInARow:Mixin.CreationDialog.Items': true
label: "${(q(node).children().count() ? q(node).children().count() + ' ' : '') + (I18n.translate(node.nodeType.label) || node.nodeType.name)}"
ui:
label: i18n
Expand Down
17 changes: 17 additions & 0 deletions Configuration/NodeTypes.Mixin.CreationDialog.Items.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'Jonnitto.ImagesInARow:Mixin.CreationDialog.Items':
abstract: true
ui:
creationDialog:
elements:
items:
type: integer
ui:
label: 'Jonnitto.ImagesInARow:NodeTypes.Container:items'
editor: Neos.Neos/Inspector/Editors/TextFieldEditor
options:
template:
childNodes:
items:
type: 'Jonnitto.ImagesInARow:Image'
when: '${data.items && data.items > 0}'
withItems: '${Array.range(1, data.items)}'
6 changes: 5 additions & 1 deletion Resources/Private/Translations/de/NodeTypes/Container.xlf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<xliff version="1.2"
xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="" product-name="Jonnitto.ImagesInARow" source-language="de" datatype="plaintext">
<body>
<trans-unit id="ui.label" xml:space="preserve">
Expand All @@ -8,6 +9,9 @@
<trans-unit id="images" xml:space="preserve">
<source>Bilder</source>
</trans-unit>
<trans-unit id="items" xml:space="preserve">
<source>Wie viele Bilder sollen erstellt werden?</source>
</trans-unit>
<trans-unit id="noImages" xml:space="preserve">
<source>Bitte fügen Sie Bilder ein</source>
</trans-unit>
Expand Down
6 changes: 5 additions & 1 deletion Resources/Private/Translations/en/NodeTypes/Container.xlf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<xliff version="1.2"
xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="" product-name="Jonnitto.ImagesInARow" source-language="en" datatype="plaintext">
<body>
<trans-unit id="ui.label" xml:space="preserve">
Expand All @@ -8,6 +9,9 @@
<trans-unit id="images" xml:space="preserve">
<source>Images</source>
</trans-unit>
<trans-unit id="items" xml:space="preserve">
<source>How many images should be generated?</source>
</trans-unit>
<trans-unit id="noImages" xml:space="preserve">
<source>Please add some images</source>
</trans-unit>
Expand Down

0 comments on commit c6df04f

Please sign in to comment.