{% load mezzanine_tags i18n future %}
<form action="{% url "search" %}" class="navbar-search pull-right">

<input class="search-query" placeholder="{% trans "Search" %}" type="text" name="q" value="{{ request.REQUEST.q }}">

{% if search_model_choices %}
    {% if search_model_choices|length == 1 %}
    <input type="hidden" name="type" value="{{ search_model_choices.0.1 }}">
    {% else %}
    <select name="type">
        <option value="">{% trans "Everything" %}</option>
        {% for verbose_name, model in search_model_choices %}
        <option value="{{ model }}"
            {% if model == request.REQUEST.type  %}selected{% endif %}>
            {{ verbose_name }}
        </option>
        {% endfor %}
        <input type="submit" class="btn" value="{% trans "Go" %}">
    </select>
    {% endif %}
{% endif %}

</form>
