<template name="editDocument">

    {{#if isConnected}}
        {{> pageHeading title='Update/Delete Document' }}
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>Edit Document
                                <small>Update/Delete MongoDB Documents, fetching internally executes a <b>findOne</b>
                                    query
                                </small>
                            </h5>
                        </div>
                        <div class="ibox-content">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-lg-1 control-label">Collection</label>
                                    <div class="col-lg-11">
                                        <select id="cmbCollections"
                                                data-placeholder="Choose a collection..."
                                                class="chosen-select form-control"
                                                tabindex="-1">
                                            <option></option>
                                        </select>
                                    </div>
                                </div>

                                {{> selector}}

                                <div class="form-group">
                                    <div class="col-lg-12">
                                        <button id="btnFetchDocument"
                                                class="btn btn-block btn-outline btn-primary ladda-button"
                                                type="button"
                                                data-style="contract">
                                            <strong>Fetch</strong></button>
                                    </div>
                                </div>

                                <div id="divResult" style="display: none;" class="form-group animated fadeInRight">
                                    <label class="col-lg-1 control-label">Document</label>
                                    <textarea id="txtDocument" class="form-control col-lg-11"></textarea>
                                </div>
                            </form>
                        </div>
                        <div class="ibox-footer" id="divFooter" style="display: none;">
                            <div class="row">
                                <div class="col-lg-6">
                                    <button id="btnDeleteDocument"
                                            class="btn btn-block btn-outline btn-danger ladda-button"
                                            type="button"
                                            data-style="contract">
                                        <i class="fa fa-remove"></i><strong> Delete</strong></button>
                                </div>
                                <div class="col-lg-6">
                                    <button id="btnSaveDocument"
                                            class="btn btn-block btn-outline btn-primary ladda-button"
                                            type="button"
                                            data-style="contract">
                                        <strong>Save</strong></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {{/if}}
</template>