<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <head>
    <title py:choose="">
      <py:when test="query">Search Results</py:when>
      <py:otherwise>Search</py:otherwise>
    </title>
    <py:if test="results">
        <meta name="startIndex" content="${results.span[0] + 1}"/>
        <meta name="totalResults" content="$results.num_items"/>
        <meta name="itemsPerPage" content="$results.max_per_page"/>
    </py:if>
    <script type="text/javascript">
      jQuery(document).ready(function($) {$("#q").get(0).focus()});
    </script>
  </head>
  <body>
    <div id="content" class="search">

      <h1><label for="q">Search</label></h1>
      <form id="fullsearch" action="${href.search()}" method="get">
        <p>
          <input type="text" id="q" name="q" size="40" value="${query}" />
          <input type="hidden" name="noquickjump" value="1" />
          <input type="submit" value="${_('Search')}" />
        </p>
        <p class="filters">
          <py:for each="filter in filters">
            <input type="checkbox" id="${filter.name}" name="${filter.name}"
                   checked="${filter.active or None}" />
            <label for="${filter.name}">${filter.label}</label>
          </py:for>
       </p>
      </form>

      <py:if test="results or quickjump"><hr />
        <h2 py:if="results">
          Results <span class="numresults">(${results.displayed_items()})</span>
        </h2>
        <xi:include py:with="paginator = results" href="page_index.html" />
        <div>
          <dl id="results">
            <py:if test="quickjump">
              <dt id="quickjump">
                <a href="${quickjump.href}" i18n:msg="name">Quickjump to ${quickjump.name}</a>
              </dt>
              <dd>${quickjump.description}</dd>
            </py:if>
            <py:for each="result in results">
              <dt><a href="${result.href}" class="searchable">${result.title}</a></dt>
              <dd class="searchable">${result.excerpt}</dd>
              <dd>
                <py:if test="result.author"><span class="author" i18n:msg="author">By ${format_author(result.author)}</span> &mdash;</py:if>
                <span class="date">${result.date}</span>
              </dd>
            </py:for>
          </dl>
        </div>
        <xi:include py:with="paginator = results" href="page_index.html" />
      </py:if>

      <div id="notfound" py:if="query and not (results or quickjump)">
        No matches found.
      </div>

      <div id="help" i18n:msg="">
        <strong>Note:</strong> See <a href="${href.wiki('TracSearch')}">TracSearch</a>
        for help on searching.
      </div>

    </div>
  </body>
</html>
