Explorar el Código

[enh][mod] template refactor

asciimoo hace 11 años
padre
commit
0531706287
Se han modificado 3 ficheros con 11 adiciones y 13 borrados
  1. 1
    9
      searx/templates/index.html
  2. 1
    4
      searx/templates/results.html
  3. 9
    0
      searx/templates/search.html

+ 1
- 9
searx/templates/index.html Ver fichero

@@ -5,14 +5,6 @@
5 5
 </a>
6 6
 <div class="center">
7 7
     <h1>searx</h1>
8
-    <form method="post" action="">
9
-        <input type="text" name="q" tabindex="1" autocomplete="off" />
10
-        <input type="submit" value="search" />
11
-        <p>
12
-        {% for engine in engines %}
13
-            {{ engine }}: <input type="checkbox" name="engine_{{ engine }}" checked="checked"/>
14
-        {% endfor %}
15
-        </p>
16
-    </form>
8
+    {% include 'search.html' %}
17 9
 </div>
18 10
 {% endblock %}

+ 1
- 4
searx/templates/results.html Ver fichero

@@ -1,9 +1,6 @@
1 1
 {% extends "base.html" %}
2 2
 {% block content %}
3
-<form method="post" action="">
4
-    <input type="text" name="q" value="{{ q }}" autocomplete="off" />
5
-    <input type="submit" value="search" />
6
-</form>
3
+{% include 'search.html' %}
7 4
 {% for result in results %}
8 5
     <div class="result">
9 6
         <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>

+ 9
- 0
searx/templates/search.html Ver fichero

@@ -0,0 +1,9 @@
1
+<form method="post" action="">
2
+    <input type="text" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
3
+    <input type="submit" value="search" />
4
+    <p>
5
+    {% for engine in engines %}
6
+        {{ engine }}: <input type="checkbox" name="engine_{{ engine }}" checked="checked"/>
7
+    {% endfor %}
8
+    </p>
9
+</form>