<template name="moduleSubmit">
    {{#autoForm id="moduleSubmit" collection=Collections.Modules class="main form module-detail" }}
        <h3>Create New Module</h3>

        {{> afQuickField name='name'}}
        {{> afQuickField name='desc' type="textarea"}}

        <div class="form-group {{#if afFieldIsInvalid name='img_id'}}has-error{{/if}}">
            <label class="control-label">{{afFieldLabelText name='img_id'}}</label>
            {{> afFieldInput name='img_id' value=image_val type='hidden' }}
            {{#if afFieldIsInvalid name='img_id'}}
                <span class="help-block">{{{afFieldMessage name='img_id'}}}</span>
            {{/if}}
        </div>
        {{> imagesArea multi=false}}

        {{# if image}}
            <a href="{{image.url}}" target="_blank">
                <img src="{{image.url store='thumbs' uploading='/images/uploading.gif' storing='/images/storing.gif'}}"
                     class="thumbnail"/>
            </a>
        {{/if}}

        <button type="submit" class="btn btn-primary">
            <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> Save
        </button>

    {{/autoForm}}
</template>