Source

moin2 / MoinMoin / templates / search_results.html

Full commit
{% extends theme("layout.html") %}
{% import "utils.html" as utils %}
{% block content %}
    {% if results %}
    <p class="searchstats">
        {{ _("Result: Page %(start_page)d of %(end_page)d.
              Showing results %(start_result)d - %(end_result)d of %(result_len)d (%(runtime).3f secs)",
              start_page=results.pagenum, end_page=results.pagecount,
              start_result=results.offset + 1, end_result=results.offset + results.pagelen,
              result_len=results|length, runtime=results.results.runtime
            )
        }}
    {% endif %}
    {{ gen.form.open(medium_search_form, id='moin-long-searchform', method='get', action=url_for('frontend.show_item', item_name=item_name)) }}
        <div>
            {{ gen.input(medium_search_form['q'], type='search', id='moin-search-query') }}
            {{ gen.input(medium_search_form['submit'], type='submit') }}
            {{ gen.input(medium_search_form['pagelen'], type='hidden', value='25') }}
            {{ forms.render_errors(medium_search_form) }}
        </div>
    {{ gen.form.close() }}
    </p>
        {% if results %}
        <div class="searchresults">
        <table>
            {% for result in results %}
            <tr>
                <td class="moin-wordbreak">{{ result.pos + 1 }}.
                <a href="{{ url_for_item(item_name=result['name'], wiki_name=result['wikiname'], rev=result['rev_no']) }}"><b>{{ result['name'] }}</b></a>
                </td>
            </tr>
            <tr>
                <td>
                <p class="info searchhitinfobar">{{ _("Revision: %(rev_no)d Last Change: %(mtime)s", rev_no=result['rev_no'], mtime=result['mtime']|datetimeformat) }}</p>
                </td>
            </tr>
            <tr>
                <td>
                <p class="info foundtext">{{ result.highlights('content')|safe }}</p>
                </td>
            </tr>
            {% endfor %}
        </table>
        </div>
    {% else %}
        <h1>{{ _("No results for '%(query)s'", query=query) }}</h1>
    {% endif %}
{% endblock %}