[GMG-Devel] [PATCH 27/83] Add html template for search page.

Alon Levy alon at pobox.com
Tue Feb 25 14:58:10 EST 2014


From: Praveen Kumar <praveen97uma at gmail.com>

---
 .../templates/mediagoblin/search/search.html       | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 mediagoblin/templates/mediagoblin/search/search.html

diff --git a/mediagoblin/templates/mediagoblin/search/search.html b/mediagoblin/templates/mediagoblin/search/search.html
new file mode 100644
index 0000000..224d68a
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/search/search.html
@@ -0,0 +1,26 @@
+{% extends "mediagoblin/base.html" %}
+{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+
+
+{% block mediagoblin_content %}    
+    <form action="{{ request.urlgen('mediagoblin.plugins.search.search') }}" method="POST">
+        {{ wtforms_util.render_divs(form) }}
+        <div class="form_submit_buttons">
+            <input type="submit" value="Go" class="button_form" />
+            {{ csrf_token }}
+        </div>
+    </form>
+    {% if results_found %}
+        {% if results %}
+            <h2> Results found for query: {{ query }} </h2>
+            <ul>
+                {% for result in results %}
+                    <li><a href = "{{ result['url'] }} "> {{ result['slug'] }}</a></li>
+                {% endfor %}
+            </ul>
+        {% else %}
+            No results found for query: {{ query }}
+        {% endif %}
+    {% endif %}
+{% endblock %} 
+
-- 
1.8.5.3



More information about the devel mailing list