kai-jacobsen/kontentblocks

View on GitHub
js/src/templates/fields/Image.hbs

Summary

Maintainability
Test Coverage
<div class="kb-field kb-field kb-field--image kb-fieldapi-field">
    <div class='kb-field-image-wrapper' data-kbfield="image">
        <div role="button" aria-label="Datei auswählen" tabindex="0" class='kb-js-add-image kb-field-image-container'>
            {{#if model.value.url }}
                <img src="{{{ model.value.url }}}">
            {{/if}}
        </div>
        <div class="kb-field-image-meta {{#if model.hideMeta }} kb-hide {{/if}} ">
            <div class="kb-field-image-title">
                <label>{{ i18n.title }}</label>
                <input class='kb-js-image-title kb-observe' type="text"
                       name='{{fieldName model.baseId model.index model.primeKey }}[title]'
                       value='{{{ model.value.title }}}'>
            </div>
            <div class="kb-field-image-description">
                <label>{{ i18n.description }}</label>
        <textarea class='kb-js-image-description kb-observe'
                  name='{{ fieldName model.baseId model.index model.primeKey }}[caption]'>{{{ model.value.caption }}}
        </textarea>
            </div>
        </div>
        <input class='kb-js-image-id' type='hidden'
               name='{{ fieldName model.baseId model.index model.primeKey }}[id]'
               value='{{{ model.value.id }}}'>
    </div>
    <div class="kb-field-image--footer">
        <a class="button kb-js-reset-image">Reset</a>
    </div>
</div>