{% extends 'iconolab_base.html' %}

{% load thumbnail %}
{% load iconolab_tags %} 

{% block content %}

    <h2>Recherche</h2>

    <form method="get" class="form-inline" action="{% url 'search_indexes:haystack_search' %}">
    <div class="form-group">
      <div class="input-group">
        <div class="input-group-addon">Chercher</div>
        <input id="id_{{form.q.name}}" type="text" class="form-control" name="{{form.q.name}}" placeholder="...">
        <div class="input-group-addon">dans les </div>
        <select class="form-control" id="id_{{form.model_type.name}}" name="{{form.model_type.name}}">
          {% for val, label in form.fields.model_type.choices %}
              <option value="{{ val }}"{% if label == 'Images' %} selected{% endif %}>{{ label }}</option>
          {% endfor %}
        </select>
        {% if form.collection_name %}
          <div class="input-group-addon">du fonds {{form.collection.verbose_name}}</div>
        {% else %}
          <div class="input-group-addon">du site</div>
        {% endif %}
      </div>
    </div>
    <input type="submit" class="search-submit btn btn-primary" value="Rechercher" style="margin-left: 10px;">
  </form>>
{% endblock %}