<template name="browseCollection">
    {{#if getSelectedCollection}}
        {{> pageHeading title=getSelectedCollection }}
        <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>Query
                                <small>You can either use mongodb or sql queries</small>
                            </h5>
                            <div class="ibox-tools">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                    <i class="fa fa-wrench"></i>
                                </a>
                                <ul class="dropdown-menu dropdown-user">
                                    <li><a href="#"><i class="fa fa-check"></i> Mongodb Queries</a>
                                    </li>
                                    <li><a href="#">SQL Queries</a>
                                    </li>
                                </ul>
                                <a id="btnSwitchView" href="#"
                                   title="Switch Result View">
                                    <i class="fa fa-exchange"></i>
                                </a>
                                <a id="btnShowQueryHistories" href="#"
                                   title="Show Query Histories">
                                    <i class="fa fa-history"></i>
                                </a>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-lg-1 control-label">Query</label>
                                    <div class="col-lg-11">
                                        <select id="cmbQueries"
                                                data-placeholder="Choose a query..."
                                                class="chosen-select form-control"
                                                tabindex="-1">
                                            <option></option>
                                        </select>
                                        <span class="help-block m-b-none">{{getHelpBlockForSelectedQuery}}</span>
                                    </div>
                                </div>

                                {{> Template.dynamic template=getQueryTemplate}}

                                <div class="form-group">
                                    <div class="col-lg-12">
                                        <button id="btnExecuteQuery"
                                                class="btn btn-block btn-outline btn-primary ladda-button"
                                                type="button"
                                                data-style="contract">
                                            <strong>Execute</strong></button>
                                    </div>
                                </div>
                                <ul id="resultTabs" class="nav nav-tabs">
                                </ul>
                                <div id="resultTabContents" class="tab-content">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        {{> queryHistories}}
    {{/if}}
</template>