Commits

Thomas Waldmann  committed e592d2c

rename template search_results.html to search.html

  • Participants
  • Parent commits 919ae0e
  • Branches pytest2

Comments (0)

Files changed (3)

File MoinMoin/apps/frontend/views.py

         q = qp.parse(query)
         with flaskg.storage.searcher(all_revs=history) as searcher:
             results = searcher.search(q, limit=100)
-            return render_template('search_results.html',
+            return render_template('search.html',
                                    results=results,
                                    query=query,
                                    medium_search_form=search_form,
                                    item_name='+search', # XXX
                                   )
     else:
-        return render_template('search_results.html',
+        return render_template('search.html',
                                query=query,
                                medium_search_form=search_form,
                                item_name='+search', # XXX

File MoinMoin/templates/search.html

+{% extends theme("layout.html") %}
+{% import "utils.html" as utils %}
+{% 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 %}
+    {{ gen.form.open(medium_search_form, id='moin-long-searchform', method='get', action=url_for('frontend.search')) }}
+        <div>
+            {{ gen.input(medium_search_form['q'], type='search', id='moin-search-query') }}
+            {{ gen.input(medium_search_form['submit'], type='submit') }}
+            {{ forms.render_field_without_markup(gen, medium_search_form['history'], 'checkbox') }}
+            {{ forms.render_errors(medium_search_form) }}
+        </div>
+    {{ gen.form.close() }}
+    {% if results is defined %}
+    <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'], wiki_name='Self', 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>
+                            {% 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['rev_no']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
+                        </td>
+                    </tr>
+                {% endif %}
+            {% endfor %}
+        </table>
+    </div>
+    {% endif %}
+{% endblock %}

File MoinMoin/templates/search_results.html

-{% extends theme("layout.html") %}
-{% import "utils.html" as utils %}
-{% 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 %}
-    {{ gen.form.open(medium_search_form, id='moin-long-searchform', method='get', action=url_for('frontend.search')) }}
-        <div>
-            {{ gen.input(medium_search_form['q'], type='search', id='moin-search-query') }}
-            {{ gen.input(medium_search_form['submit'], type='submit') }}
-            {{ forms.render_field_without_markup(gen, medium_search_form['history'], 'checkbox') }}
-            {{ forms.render_errors(medium_search_form) }}
-        </div>
-    {{ gen.form.close() }}
-    {% if results is defined %}
-    <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'], wiki_name='Self', 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>
-                            {% 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['rev_no']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
-                        </td>
-                    </tr>
-                {% endif %}
-            {% endfor %}
-        </table>
-    </div>
-    {% endif %}
-{% endblock %}