{namespace neos=Neos\Neos\ViewHelpers}

<div class="o-container o-container--sm {marginTop}">
    <figure class="c-image{f:if(condition: imageClassName, then: ' {imageClassName}')}">
        <f:render partial="SimpleImage" arguments="{_all}" />
        <f:if condition="!{hideCaption}">
            <figcaption class="c-image__caption">
                {neos:contentElement.editable(property: 'caption', node: node)}
            </figcaption>
        </f:if>

        <f:if condition="{imageDecoration} && {hideCaption}">
            <f:if condition="{copyrightnotice}">
                <p class="c-image__copyrightnotice">&#169; {copyrightnotice}</p>
            </f:if>
            <f:if condition="{imageDecorationAlignment} == 'stretched'">
                <f:then>
                    <img class="c-image__decoration c-image__decoration--stretched" src="{neos.media:uri.image(image: imageDecoration)}"
                        {f:if(condition: nodesRoundEdges, then: "style='width: 100%; border-radius: 10px;'", else: "style='width: 100%;'")}>
                </f:then>
                <f:else>
                    <f:if condition="{imageDecorationAlignment} == 'pattern'">
                        <f:then>
                            <div class="c-image__decoration c-image__decoration--pattern" style="background-image: url('{neos.media:uri.image(image: imageDecoration)}');">
                            </div>
                                <img src="{neos.media:uri.image(image: imageDecoration)}" style="visibility: hidden;">
                            </div>
                        </f:then>
                        <f:else>
                            <img class="c-image__decoration c-image__decoration--centered" src="{neos.media:uri.image(image: imageDecoration)}"
                                {f:if(condition: nodesRoundEdges, then: "style='border-radius: 10px;'", else: '')}>
                        </f:else>
                    </f:if>
                </f:else>
            </f:if>
        </f:if>

    </figure>
</div>
