Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(91)

Unified Diff: MoinMoin/templates/search.html

Issue 10935045: Ajax Searches in moin
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « MoinMoin/templates/ajaxsearch.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: MoinMoin/templates/search.html
===================================================================
--- a/MoinMoin/templates/search.html
+++ b/MoinMoin/templates/search.html
@@ -9,19 +9,7 @@
{{ super() }}
{% endblock %}
-{% block content %}
- {% if results is defined %}
- <p class="searchstats">
- {% if results %}
- {{ _("%(result_len)d results found (%(runtime).3f secs).",
- result_len=results|length, runtime=results.runtime
- )
- }}
- {% else %}
- {{ _("No results found (%(runtime).3f secs).", runtime=results.runtime) }}
- {% endif %}
- </p>
- {% endif %}
+{% block content %}
{{ gen.form.open(medium_search_form, id='moin-long-searchform', method='get', action=url_for('frontend.search', item_name=item_name)) }}
<p>
{{ forms.render(medium_search_form['q']) }}
@@ -32,52 +20,12 @@
{{ forms.render_errors(medium_search_form) }}
</p>
{{ gen.form.close() }}
- {% if results is defined %}
- {% if name_suggestions or content_suggestions %}
- <p>{{ _("name term suggestions: %(termlist)s", termlist=name_suggestions) }}</p>
- <p>{{ _("content term suggestions: %(termlist)s", termlist=content_suggestions) }}</p>
- {% endif %}
- {% if results %}
- <div class="searchresults">
- <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'][0], wiki_name='Self', rev=result['revid']) }}"><b>{{ result['name'] | join(' | ')}}</b></a>
- </td>
- </tr>
- {% if result['summary'] %}
- <tr>
- <td>
- <p class="info searchhitinfobar">{{ _("Summary: %(summary)s", summary=result['summary']) }}</p>
- </td>
- </tr>
- {% endif %}
- <tr>
- <td>
- <p class="info searchhitinfobar">{{ _("Revision: %(revid)s Last Change: %(mtime)s", revid=result['revid']|shorten_id, mtime=result['mtime']|datetimeformat) }}</p>
- </td>
- </tr>
- <tr>
- <td>
- {% if user.may.read(result['name']) %}
- <p class="info foundtext">{{ result.highlights('content')|safe }}</p>
- {% else %}
- <p class="info foundtext">{{ _("You don't have read permission for this item.") }}</p>
- {% endif %}
- </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 %}
+ <div id="finalresults">
+ {% include "ajaxsearch.html" %}
+ </div>
{% endblock %}
+
+{% block body_scripts %}
+ <script src="{{ url_for('serve.files', name='jquery', filename='jquery.min.js') }}"></script>
+ <script src="{{ url_for('static', filename='js/search.js') }}"></script>
+{% endblock %}
« no previous file with comments | « MoinMoin/templates/ajaxsearch.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b