<!--
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->
<div class="errors-container"></div>
<form class="js-view-query-update custom-inputs">

<!-- tabs for choosing Keys or Start & end -->

  <div class="btn-group toggle-btns">
    <label for="showKeys" class="drop-down btn active">
     Specific Keys 
    </label>
    <label for="showStartEnd" class="drop-down btn">
      Bounded Queries
    </label>
  </div>

  <div class="controls-group well">
    <div class="row-fluid" id="js-showKeys">
      <div class="controls controls-row">
        <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON."></textarea>
        <div id="keys-error" class="inline-block js-keys-error"></div>
      </div>
    </div>
    <div class="row-fluid hide" id="js-showStartEnd">
      <div class="controls controls-row">
        <input name="startkey" class="span6" type="text" placeholder="Start Key" disabled>
        <input name="endkey" class="span6" type="text" placeholder="End Key">
      </div>
      <div class="controls controls-row checkbox inline">  
        <input id="check5" name="inclusive_end" type="checkbox" value="false" disabled>
        <label for="check5">Disable Inclusive End</label>
      </div>
    </div>
  </div>

<!-- Limit and Skip are conditional -->

  <div class="controls-group">
      <label class="drop-down inline">
        Limit:
        <select name="limit" class="input-small">
          <option selected="selected">None</option>
          <option>5</option>
          <option>10</option>
          <option>20</option>
          <option>30</option>
          <option>50</option>
          <option>100</option>
		      <option>500</option>
        </select>
      </label>
      <label for="skipRows" class="inline drop-down">
        Skip: 
        <input name="skip" class="input-large" type="text" id="skipRows" placeholder="Number of rows to skip">
      </label>

      <div class="checkbox inline"> 
        <input id="check1" type="checkbox" name="include_docs" value="true">  
        <label name="include_docs" for="check1">Include Docs (show the entire doc body)</label>  
      </div>

      <% if (hasReduce) { %>
      <div class="checkbox inline">  
        <input id="check2" name="reduce" type="checkbox" value="true">
        <label for="check2">Reduce</label>  
      </div> 
      <label id="select1" class="drop-down inline">
        Group Level:
        <select id="select1" disabled name="group_level" class="input-small">
          <option value="0">None</option>
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
          <option value="6">6</option>
          <option value="7">7</option>
          <option value="8">8</option>
          <option value="9">9</option>
          <option value="999" selected="selected">exact</option>
        </select>
      </label>
      <% } %>

      <label id="select2" class="drop-down inline">
        Order: 
        <select id="select2" name="descending" class="input-large">
          <option value="false">Accending</option>
          <option value="true">Descending</option>
        </select>
      </label>

      <div class="checkbox inline">  
        <input id="check6" name="update_seq" type="checkbox" value="true">  
        <label for="check6">Update Sequence</label>  
      </div>

      <% if (showPreview) { %>
      <div class="checkbox inline">  
        <input id="check7" name="stale" type="checkbox" value="true">  
        <label for="check7">Stale</label>  
      </div>
      <% } %>
  </div>




  <div class="controls-group">
    <div class="row-fluid">
      <div id="button-options" class="controls controls-row">
        <button type="submit" class="btn btn-success">Query</button>
        <% if (showPreview) { %>
        <button class="btn btn-info preview">Browser Preview</button>
        <% } %>
      </div>
    </div>
  </div>
</form>
</div>

