on master help sign in
[enh] result rendering templates
fd0a93dasciimoo
searx/static/css/style.css+6−1
@@ -64,7 +64,7 @@ input[type="checkbox"] { visibility: hidden; }
64a { text-decoration: none; }
64a { text-decoration: none; }
65
65
66
66
67−.result { margin-bottom: 16px; }
67+.result { margin-bottom: 16px; clear: both; }
68.result_title { margin-bottom: 0; }
68.result_title { margin-bottom: 0; }
69.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; }
69.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; }
70.result h3 { font-size: 0.9em;}
70.result h3 { font-size: 0.9em;}
@@ -76,8 +76,13 @@ a { text-decoration: none; }
76
76
77.engines { color: #888888; }
77.engines { color: #888888; }
78
78
79+.small_font { font-size: 0.8em; }
80+
79.small p { margin: 2px 0; }
81.small p { margin: 2px 0; }
80
82
81.right { float: right; }
83.right { float: right; }
82
84
83.invisible { display: none; }
85.invisible { display: none; }
86+
87+.image_result { float: left; max-width: 250px; margin: 10px; height: 350px; min-width: 250px; }
88+.image_result img { max-width: 240px; max-height: 320px; border: 2px solid #000000; }
searx/templates/result_templates/default.htmlnew file+4
@@ -0,0 +1,4 @@
1+<div class="result">
2+ <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3+ <p class="content"><span class="engines">{{ result.engine }}</span><br />{% if result.content %}{{ result.content|safe }}<br />{% endif %}<span class="url">{{ result.url }}</span></p>
4+</div>
searx/templates/results.html+5−4
@@ -9,10 +9,11 @@
9</div>
9</div>
10<div id="results">
10<div id="results">
11 {% for result in results %}
11 {% for result in results %}
12− <div class="result">
12+ {% if result['template'] %}
13− <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
13+ {% include 'result_templates/'+result['template'] %}
14− <p class="content"><span class="engines">{{ result.engine }}</span><br />{% if result.content %}{{ result.content|safe }}<br />{% endif %}<span class="url">{{ result.url }}</span></p>
14+ {% else %}
15− </div>
15+ {% include 'result_templates/default.html' %}
16+ {% endif %}
16 {% endfor %}
17 {% endfor %}
17</div>
18</div>
18{% endblock %}
19{% endblock %}