view MoinMoin/templates/lookup.html @ 1988:490c13d072f2

remove Submit widget The Submit widget was a mistake. The buttons carry no user input, and making it part of the form screws up POST form handling. Instead of being a widget, the submit button has its label kept in the class member submit_label of the Form, and is rendered by a new macro forms.render_submit.
author Cheer Xiao <xiaqqaix@gmail.com>
date Tue, 12 Feb 2013 10:28:18 +0800
parents 100197cb69ab
children d993f93428bc
line wrap: on
line source
{% extends theme("layout.html") %}
{% import "utils.html" as utils %}
{% import "forms.html" as forms %}
{% block content %}
    {% if results is not defined %}
    <h1>{{ _("Lookup") }}</h1>
    {{ gen.form.open(lookup_form, id='moin-lookup-form', method='get', action=url_for('frontend.lookup')) }}
        {{ forms.render_errors(lookup_form) }}
        <dl>
            {% for e in [
                'name',
                'name_exact',
                'itemid',
                'revid',
                'userid',
                'language',
                'itemlinks',
                'itemtransclusions',
                'refs',
                'tags',
                'history',
                ] %}
                {{ forms.render(lookup_form[e]) }}
            {% endfor %}
        </dl>
        {{ forms.render_submit(lookup_form) }}
    {{ gen.form.close() }}
    {% else %}
    {% if not results %}
    <h1>{{ _("No results") }}</h1>
    {% else %}
    <h1>{{ _("More than one result") }}</h1>
    <div class="lookupresults">
        <table>
            {% for result in results %}
                {% if result['wikiname'] == cfg.interwikiname %}
                    <tr>
                        <td class="moin-wordbreak">{{ result.pos + 1 }}
                        <a href="{{ url_for_item(item_name=result['name'], wiki_name='Self', rev=result['revid']) }}"><b>{{ result['name'] }}</b></a>
                        </td>
                    </tr>
                {% else %}
                    <tr>
                        <td class="moin-wordbreak">{{ result.pos + 1 }}
                        <a class="moin-interwiki" href="{{ url_for_item(item_name=result['name'], wiki_name=result['wikiname'], rev=result['revid']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
                        </td>
                    </tr>
                {% endif %}
            {% endfor %}
        </table>
    </div>
    {% endif %}
    {% endif %}
{% endblock %}