浏览代码

[enh] result rendering templates

asciimoo 11 年前
父节点
当前提交
fd0a93dd7c
共有 3 个文件被更改,包括 15 次插入5 次删除
  1. 6
    1
      searx/static/css/style.css
  2. 4
    0
      searx/templates/result_templates/default.html
  3. 5
    4
      searx/templates/results.html

+ 6
- 1
searx/static/css/style.css 查看文件

64
 a { text-decoration: none; }
64
 a { 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
 
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; }

+ 4
- 0
searx/templates/result_templates/default.html 查看文件

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>

+ 5
- 4
searx/templates/results.html 查看文件

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">
13
-            <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
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>
15
-        </div>
12
+        {% if result['template'] %}
13
+            {% include 'result_templates/'+result['template'] %}
14
+        {% else %}
15
+            {% include 'result_templates/default.html' %}
16
+        {% endif %}
16
     {% endfor %}
17
     {% endfor %}
17
 </div>
18
 </div>
18
 {% endblock %}
19
 {% endblock %}