From fd0a93dd7ce6b701dfb5fe48d3196aee23d19621 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Tue, 22 Oct 2013 23:32:52 +0200 Subject: [PATCH] [enh] result rendering templates --- searx/static/css/style.css | 7 ++++++- searx/templates/result_templates/default.html | 4 ++++ searx/templates/results.html | 9 +++++---- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 searx/templates/result_templates/default.html diff --git a/searx/static/css/style.css b/searx/static/css/style.css index 7c8ba5819..3ba2caa6c 100644 --- a/searx/static/css/style.css +++ b/searx/static/css/style.css @@ -64,7 +64,7 @@ input[type="checkbox"] { visibility: hidden; } a { text-decoration: none; } -.result { margin-bottom: 16px; } +.result { margin-bottom: 16px; clear: both; } .result_title { margin-bottom: 0; } .result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; } .result h3 { font-size: 0.9em;} @@ -76,8 +76,13 @@ a { text-decoration: none; } .engines { color: #888888; } +.small_font { font-size: 0.8em; } + .small p { margin: 2px 0; } .right { float: right; } .invisible { display: none; } + +.image_result { float: left; max-width: 250px; margin: 10px; height: 350px; min-width: 250px; } +.image_result img { max-width: 240px; max-height: 320px; border: 2px solid #000000; } diff --git a/searx/templates/result_templates/default.html b/searx/templates/result_templates/default.html new file mode 100644 index 000000000..99789484a --- /dev/null +++ b/searx/templates/result_templates/default.html @@ -0,0 +1,4 @@ +
+

{{ result.title|safe }}

+

{{ result.engine }}
{% if result.content %}{{ result.content|safe }}
{% endif %}{{ result.url }}

+
diff --git a/searx/templates/results.html b/searx/templates/results.html index 6f45e8bcd..fc935c37d 100644 --- a/searx/templates/results.html +++ b/searx/templates/results.html @@ -9,10 +9,11 @@
{% for result in results %} -
-

{{ result.title|safe }}

-

{{ result.engine }}
{% if result.content %}{{ result.content|safe }}
{% endif %}{{ result.url }}

-
+ {% if result['template'] %} + {% include 'result_templates/'+result['template'] %} + {% else %} + {% include 'result_templates/default.html' %} + {% endif %} {% endfor %}
{% endblock %}