Skip to content

Commit

Permalink
♻️ Add warning to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed May 17, 2019
1 parent 56f2375 commit 8cff25a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Resources/Private/Fusion/ContentElements/Container.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ prototype(Jonnitto.ImagesInARow:Container) < prototype(Neos.Neos:ContentCollecti
namespace = ${this.namespace}
}

attributes.class = Neos.Fusion:RawArray {
namespace = ${container || node.context.inBackend ? false : namespace}
row = ${namespace + '__row'}
attributes{
data-warning = ${node.context.inBackend ? Translation.translate('noImages', 'Please add some images', [], 'NodeTypes/Container', 'Jonnitto.ImagesInARow') : false}
class = Neos.Fusion:RawArray {
namespace = ${container || node.context.inBackend ? false : namespace}
row = ${BEM.string(namespace, 'row')}
}
}

@process {
containerWrapping = Neos.Fusion:Tag {
@if.needWrapping = ${container || node.context.inBackend}
attributes.class = Neos.Fusion:RawArray {
namespace = ${namespace}
imagesinarow = ${container ? namespace + '__container' : false}
imagesinarow = ${container ? BEM.string(namespace, 'container') : false}
container = ${Type.isString(container) ? container : false}
}
content = ${value}
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Translations/de/NodeTypes/Container.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<trans-unit id="images" xml:space="preserve">
<source>Bilder</source>
</trans-unit>
<trans-unit id="noImages" xml:space="preserve">
<source>Bitte fügen Sie Bilder ein</source>
</trans-unit>
</body>
</file>
</xliff>
3 changes: 3 additions & 0 deletions Resources/Private/Translations/en/NodeTypes/Container.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<trans-unit id="images" xml:space="preserve">
<source>Images</source>
</trans-unit>
<trans-unit id="noImages" xml:space="preserve">
<source>Please add some images</source>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 8cff25a

Please sign in to comment.