{% extends g.theme.master %}
{% import "forgechat:templates/chat/chat_lib.html" as clib %}

{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Search{% endblock %}

{% block header %}ForgeChat Search{% endblock %}

{% block content %}
  {{ clib.checkout_info(c.app) }}
  <form method="GET" action="search" class="grid-19">
    <input type="text" name="q" value="{{q}}"/><br/>
    Search history? <input type="checkbox" name="history" {% if history %}checked="checked"{% endif %}/><br/>
    <input type="submit" value="Search"/>
  </form>
  {% if count==0 and q %}
    <p>No results.</p>
  {% elif count==1 and q %}
    <p>{{count}} result.</p>
  {% elif count > 1 and q %}
    <p>{{count}} results.</p>
  {% endif %}

  {% for doc in results %}
  <div class="grid-19">
    <a href="{{doc['url_s']}}">{{doc.title_s}}</a><br/>
    <pre>{{doc|pprint}}</pre>
    <hr/>
  </div>
  {% endfor %}
{% endblock %}
