commit: 053170628739dc63b87711dd79b580e3d41bebb0
parent: 3373b2c2987302087777c89c4419fd7b67ca579e
Author: asciimoo <asciimoo@gmail.com>
Date: Thu, 17 Oct 2013 01:53:52 +0200
[enh][mod] template refactor
Diffstat:
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/searx/templates/index.html b/searx/templates/index.html
@@ -5,14 +5,6 @@
</a>
<div class="center">
<h1>searx</h1>
- <form method="post" action="">
- <input type="text" name="q" tabindex="1" autocomplete="off" />
- <input type="submit" value="search" />
- <p>
- {% for engine in engines %}
- {{ engine }}: <input type="checkbox" name="engine_{{ engine }}" checked="checked"/>
- {% endfor %}
- </p>
- </form>
+ {% include 'search.html' %}
</div>
{% endblock %}
diff --git a/searx/templates/results.html b/searx/templates/results.html
@@ -1,9 +1,6 @@
{% extends "base.html" %}
{% block content %}
-<form method="post" action="">
- <input type="text" name="q" value="{{ q }}" autocomplete="off" />
- <input type="submit" value="search" />
-</form>
+{% include 'search.html' %}
{% for result in results %}
<div class="result">
<h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
diff --git a/searx/templates/search.html b/searx/templates/search.html
@@ -0,0 +1,9 @@
+<form method="post" action="">
+ <input type="text" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
+ <input type="submit" value="search" />
+ <p>
+ {% for engine in engines %}
+ {{ engine }}: <input type="checkbox" name="engine_{{ engine }}" checked="checked"/>
+ {% endfor %}
+ </p>
+</form>