<button id="filter-toggle" type="button" class="btn btn-primary btn-xs" data-toggle="collapse" data-target="#filterdiv">
  Hide/Show filter
</button>
  
<div id="filterdiv" class="collapse well well-small">  
  <form method="POST" id="filter" class="nav form-search">
    <table class="searchTable">
      {% if (current_user is defined and current_user.is_authenticated())or listLogin == False %}
        <tr>
          <td class="text">BlackList</td>
          <td>
            <select name="blacklistSelect" id="blacklistSelect">
              <option value="on">On</option>
              <option value="off">Off</option>
              <option value="mark">Mark blacklisted</option>
            </select>
          </td>
          <td>Whitelist</td>
          <td>
            <select name="whitelistSelect" id="whitelistSelect">
              <option value="on">On</option>
              <option value="off">Off</option>
              <option value="hide">Hide whitelisted</option>
            </select>
          </td>
          <td>Unlisted</td>
          <td>
            <select name="unlistedSelect" id="unlistedSelect">
              <option value="show">Show</option>
              <option value="hide">Hide</option>
            </select>
          </td>
        </tr>
      {% endif %}
      <tr>
        <td class="text">Time</td>
        <td colspan="5">
          <select onChange="timeSelectDisable()" name="timeSelect" id="timeSelect">
            <option value="all">All</option>
            <option value="from">From</option>
            <option value="until">Until</option>
            <option value="between">Between</option>
            <option value="outside">Not During</option>
          </select>
          <input type="date" placeholder="Start date" name="startDate" id="startDate" readOnly Title="Date in dd/mm/yyyy or dd/mm/yy format, using / or -" pattern="^(?:(?:31(-|\/)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(-|\/)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(-|\/)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(-|\/)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$"></input>
          <input type="date" placeholder="End date" name="endDate" id="endDate" readOnly Title="Date in dd/mm/yyyy or dd/mm/yy format, using / or -" pattern="^(?:(?:31(-|\/)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(-|\/)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(-|\/)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(-|\/)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$"></input>
          <select name="timeTypeSelect" id="timeTypeSelect" readOnly>
            <option value="Modified">Last Major Update</option>
            <option value="Published">Published</option>
            <option value="last-modified">Last Update</option>
          </select>
        </td>
      </tr>
      <tr>
        <td class="text">CVSS</td>
        <td>
          <select name="cvssSelect" id="cvssSelect" onChange="cvssSelectDisable()">
            <option value="all">All</option>
            <option value="above">Above</option>
            <option value="equals">Equals</option>
            <option value="below">Below</option>
          </select>
          <input name="cvss" id="cvss" type="number" readOnly min="0" max="10" step="0.5" value="0"></input>
        </td>
        <td>Rejected</td>
        <td>
          <select name="rejectedSelect" id="rejectedSelect">
            <option value="hide">Hide</option>
            <option value="show">Show</option>
          </select>
        </td>
        <td></td><td></td>
      </tr>
      {% if filters is defined %}
        {% for filterSet in filters %}
          {% if not (filterSet['auth'] and not current_user.is_authenticated()) %}
            <tr><td>{{filterSet['id']}}</td><td>
              {% for filter_ in filterSet['filters'] %}
                {% if   filter_['type'] == "select" %}
                  <select name="plug_{{filter_['id']}}" id="plug_{{filter_['id']}}">
                    {% for entry in filter_['values'] %} <option value="{{entry['id']}}">{{entry['text']}}</option> {% endfor %}
                  </select>
                {% elif filter_['type'] == "text" or filter_['type'] == "checkbox"%}
                  {% if 'label' in filter_ %}<span>{{filter_['label']}}</span>{% endif %}
                  <input name="plug_{{filter_['id']}}" id="plug_{{filter_['id']}}" type="{{filter_['type']}}"></input>
                {% endif %}
              {% endfor %}
            </td></tr>
          {% endif %}
        {% endfor %}
      {% endif %}
    </table>
    <input type="submit" value="Search"/>
  </form>
</div>
