{% extends "search/base.html" %}
{% if advanced != '0' %}
  {% set classes = 'advanced_search' %}
{% endif %}

{% block content %}
<section id="content">
  <div class="wrap">
    <div id="content-main" class="full">
<article id="search-page" class="main">
  {% if advanced != '0' %}
  <div id="search-tabs">
    <span id="where" style="display: none">{{ search_form.w.data or '' }}</span>
    <div id="tab-wrapper">
    <form id="kb" method="get">
      <div class="container">
        <label for="kb_q">{{ _('Article contains') }}</label>
        <input name="q" class="auto-fill" id="kb_q" placeholder="{{ _('crashes on youtube') }}" value="{{ search_form.q.data or '' }}" type="text" />
      </div>

      <div class="container">
        {{ search_form.language.label_tag()|safe }}
        {{ search_form.language|safe }}
      </div>

      <div class="container">
        {{ search_form.category.label_tag()|safe }}
        <div class="category checkboxes">
          {{ search_form.category|safe }}
        </div>
      </div>

      <div class="container">
        {{ search_form.fx.label_tag()|safe }}
        <div class="checkboxes">
          {{ search_form.fx|safe }}
        </div>
      </div>

      <div class="container">
        {{ search_form.os.label_tag()|safe }}
        <div class="checkboxes">
          {{ search_form.os|safe }}
        </div>
      </div>

      <div class="container">
        {{ search_form.tags.label_tag()|safe }}
        {{ search_form.tags|safe }}
        <div class="search-tips-small">
          {{ _('Note: Searching for "tag1, tag2" returns articles tagged with both tag1 and tag2') }}
        </div>
      </div>

      {% for hidden in search_form.hidden_fields() if not hidden.name == 'w' %}
        {{ hidden|safe }}
      {% endfor %}
      <input type="hidden" value="1" name="w" />

      <div class="submit-search">
        <input type="submit" value="{{ _('Search', 'button') }}" />
      </div>
    </form>{# kb #}
    </div>{# tab-wrapper #}
  </div>{# search-tabs #}

  <a href="{{ url('search')|urlparams(q=search_form.q.data) }}">{{ _('Use basic search') }}</a>
  {% else %}
    {% import "search/basic-form.html" as basic %}
    {{ basic.form(q=search_form.q.data) }}
    <a href="{{ url('search')|urlparams(a=2, q=search_form.q.data) }}">{{ _('Use advanced search') }}</a>
  {% endif %}
</article>
    </div>
   </div>
</section>
{% endblock %}
