search_form.html 930 B

1234567891011121314151617181920212223242526272829
  1. {% load mezzanine_tags i18n %}
  2. <form action="{% url "search" %}" class="navbar-form navbar-right" role="search">
  3. <div class="form-group">
  4. <input class="form-control" placeholder="{% trans "Search" %}" type="text" name="q" value="{{ request.GET.q }}">
  5. </div>
  6. {% if search_model_choices %}
  7. {% if search_model_choices|length == 1 %}
  8. <input type="hidden" name="type" value="{{ search_model_choices.0.1 }}">
  9. {% else %}
  10. <div class="form-group">
  11. <select class="form-control" name="type">
  12. <option value="">{% trans "Todo" %}</option>
  13. {% for verbose_name, model in search_model_choices %}
  14. <option value="{{ model }}"
  15. {% if model == request.GET.type %}selected{% endif %}>
  16. {{ verbose_name }}
  17. </option>
  18. {% endfor %}
  19. </select>
  20. </div>
  21. {% endif %}
  22. {% endif %}
  23. <input type="submit" class="btn btn-default" value="{% trans "Ir" %}">
  24. </form>