on master help sign in
[enh] oscar_template: improve result visualisation

* highlight parts of result * add link to archiv.to * fix little bugs * add little icons * change style of "show map" button

commit2e7723a6c1ce51c6b3830470164ac818126760ae authorThomas Pointhuber <thomas.pointhuber@gmx.at> dateMon 3 Nov 2014, 10:39 (12 years ago) parentb2c976a
10 files changed+66−17
searx/static/oscar/css/leaflet.min.css+2−2 searx/static/oscar/css/oscar.min.css+5 searx/static/oscar/less/oscar/cursor.less+4 searx/static/oscar/less/oscar/results.less+29 searx/templates/oscar/base.html+1−1 searx/templates/oscar/result_templates/default.html+5−2 searx/templates/oscar/result_templates/images.html+1−1 searx/templates/oscar/result_templates/map.html+10−6 searx/templates/oscar/result_templates/torrent.html+3−2 searx/templates/oscar/result_templates/videos.html+6−3
searx/static/oscar/css/leaflet.min.css+2−2
@@ -55,8 +55,8 @@
5555.leaflet-touch .leaflet-control-zoom-in{font-size:22px}
5656.leaflet-touch .leaflet-control-zoom-out{font-size:24px}
5757.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}
58−.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}
59−.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}
58+.leaflet-control-layers-toggle{background-image:url(../img/map/layers.png);width:36px;height:36px}
59+.leaflet-retina .leaflet-control-layers-toggle{background-image:url(../img/map/layers-2x.png);background-size:26px 26px}
6060.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}
6161.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}
6262.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}
searx/static/oscar/css/oscar.min.css+5
@@ -3,11 +3,15 @@ body{margin-bottom:80px}
33.footer{position:absolute;bottom:0;width:100%;height:60px}
44input[type=checkbox]:checked~.label_hide_if_checked{display:none}
55input[type=checkbox]:not(:checked)~.label_hide_if_not_checked{display:none}
6+.result_header{margin-bottom:5px;margin-top:20px}.result_header .favicon{margin-bottom:-3px}
7+.result_header a{vertical-align:bottom}.result_header a .highlight{font-weight:bold}
8+.result-content .highlight{font-weight:bold}
69.result-default{clear:both}
710.result-images{float:left !important}
811.img-thumbnail{margin:5px;max-height:128px;min-height:128px}
912.result-videos{clear:both}
1013.result-torrents{clear:both}
14+.result-map{clear:both}
1115.suggestion_item{margin:2px 5px}
1216.result_download{margin-right:5px}
1317#pagination{margin-top:30px;padding-bottom:50px}
@@ -15,3 +19,4 @@ input[type=checkbox]:not(:checked)~.label_hide_if_not_checked{display:none}
1519.infobox .infobox_part:last-child{margin-bottom:0}
1620.search_categories{margin:10px 0;text-transform:capitalize}
1721.cursor-text{cursor:text !important}
22+.cursor-pointer{cursor:pointer !important}
searx/static/oscar/less/oscar/cursor.less+4
@@ -2,3 +2,7 @@
22.cursor-text {
33 cursor: text !important;
44}
5+
6+.cursor-pointer {
7+ cursor: pointer !important;
8+}
searx/static/oscar/less/oscar/results.less+29
@@ -1,3 +1,27 @@
1+
2+.result_header {
3+ margin-bottom:5px;
4+ margin-top:20px;
5+
6+ .favicon {
7+ margin-bottom:-3px;
8+ }
9+
10+ a {
11+ vertical-align: bottom;
12+
13+ .highlight {
14+ font-weight:bold;
15+ }
16+ }
17+}
18+
19+.result-content {
20+ .highlight {
21+ font-weight:bold;
22+ }
23+}
24+
125// default formating of results
226.result-default {
327 clear: both;
@@ -24,6 +48,11 @@
2448 clear: both;
2549}
2650
51+// map formating of results
52+.result-map {
53+ clear: both;
54+}
55+
2756// suggestion
2857.suggestion_item {
2958 margin: 2px 5px;
searx/templates/oscar/base.html+1−1
@@ -66,6 +66,6 @@
6666 <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
6767 {% if autocomplete %}<script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{% endif %}
6868 <script src="{{ url_for('static', filename='js/require-2.1.15.min.js') }}"></script>
69− <script src="{{ url_for('static', filename='js/scripts.js') }}"></script>-->
69+ <script src="{{ url_for('static', filename='js/scripts.js') }}"></script>
7070</body>
7171</html>
searx/templates/oscar/result_templates/default.html+5−2
@@ -1,8 +1,11 @@
1−<h3>{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
1+{% from 'oscar/macros.html' import icon %}
2+
3+<h4 class="result_header">{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
24
35{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
6+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
47
5−{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
8+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
69
710<div class="clearfix"></div>
811
searx/templates/oscar/result_templates/images.html+1−1
@@ -11,7 +11,7 @@
1111 </div>
1212 <div class="modal-body">
1313 <img class="img-responsive center-block" src="{{ result.img_src }}" alt="{{ result.title }}">
14− {% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
14+ {% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
1515 </div>
1616 <div class="modal-footer">
1717 <div class="clearfix"></div>
searx/templates/oscar/result_templates/map.html+10−6
@@ -1,12 +1,16 @@
1−<h3>{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
1+{% from 'oscar/macros.html' import icon %}
22
3−{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
4−
5−{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
3+<h4 class="result_header">{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
64
7−{% if result.latitude and result.longitude %}
8− <button type="button" class="btn btn-default btn-collapse collapsed searx_init_map" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('Show Map') }}" data-btn-text-not-collapsed="{{ _('Hide Map') }}">{{ _('Show Map') }}</button>
5+{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
6+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
7+{% if (result.latitude and result.longitude) or result.boundingbox %}
8+ <small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
9+{% endif %}
10+
11+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
912
13+{% if (result.latitude and result.longitude) or result.boundingbox %}
1014 <div class="collapse" id="result-map-{{ index }}">
1115 <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
1216 </div>
searx/templates/oscar/result_templates/torrent.html+3−2
@@ -1,14 +1,15 @@
11{% from 'oscar/macros.html' import icon %}
22
3−<h3>{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3+<h4 class="result_header">{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
44
55{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
6+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
67
78<p>{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span>, {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>
89
910<p><a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a></p>
1011
11−{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
12+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
1213
1314<div class="clearfix"></div>
1415
searx/templates/oscar/result_templates/videos.html+6−3
@@ -1,11 +1,14 @@
1−<h3>{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
1+{% from 'oscar/macros.html' import icon %}
2+
3+<h4 class="result_header">{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
24
35{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
4−
6+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
7+
58<div class="container-fluid">
69 <div class="row">
710 <img class="thumbnail col-xs-6 col-sm-4 col-md-4" src="{{ result.thumbnail|safe }}" />
8− {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif %}
11+ {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
912 </div>
1013</div>
1114