<template name="moduleEdit">
    {{#autoForm id="moduleEdit" collection=Collections.Modules doc=this class="main form module-detail"}}
        <div class="module-title">
            <h3>Edit Module</h3>
        </div>
        <div class="module-desc">

            {{> afQuickField name='_id' type='hidden'}}
            {{> 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>

        </div>
    {{/autoForm}}
</template>