<div class="panel panel-info fields-select hideable">
  <div class="panel-body">
    {% import 'includes/filters/filter-variables.j2' as vars %}
    <p class="doc">
      Include rows that match <strong>any</strong> of the following queries
      <a class="pull-right" target="_blank" href="https://github.com/HXLStandard/libhxl-python/wiki/Select-rows-filter">
        <span class="glyphicon glyphicon-question-sign"></span>
      </a>
    </p>

    {% set name='select-query%02d' % n %}
    <div id="{{ name }}" class="form-group required">
      <label for="{{ name }}">Queries (e.g. adm1=Bomo)</label>
      {% for n in range(1, 25) %}
      {% set query_name = '%s-%02d' % (name, n) %}
      {% if n == 1 or recipe.args[query_name] %}
      <input class="form-control" name="{{ query_name }}" value="{{ recipe.args[query_name] }}" pattern="^{{ vars.query_pattern }}$" title="{{ vars.query_help }}" placeholder="#tag=value" />
      {% endif %}
      {% endfor %}
      <a onclick="hxl_proxy.addField(this)"><span class="glyphicon glyphicon-plus-sign"></span></a>
    </div>

    {% set name='select-reverse%02d' % n %}
    <div id="{{ name }}" class="checkbox">
      <label>
        <input type="checkbox" name="{{ name }}"{% if recipe.args[name] %} checked="checked"{% endif %} />
        Invert query (include rows that <strong>don't</strong> match any of the queries)
      </label>
    </div>

  </div>
</div>
