From 2e7723a6c1ce51c6b3830470164ac818126760ae Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Mon, 3 Nov 2014 10:39:47 +0100 Subject: [PATCH] [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 --- searx/static/oscar/css/leaflet.min.css | 4 +-- 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 | 2 +- .../oscar/result_templates/default.html | 7 +++-- .../oscar/result_templates/images.html | 2 +- .../templates/oscar/result_templates/map.html | 16 ++++++---- .../oscar/result_templates/torrent.html | 5 ++-- .../oscar/result_templates/videos.html | 9 ++++-- 10 files changed, 66 insertions(+), 17 deletions(-) diff --git a/searx/static/oscar/css/leaflet.min.css b/searx/static/oscar/css/leaflet.min.css index 417e0e8e..bca0c58b 100644 --- a/searx/static/oscar/css/leaflet.min.css +++ b/searx/static/oscar/css/leaflet.min.css @@ -55,8 +55,8 @@ .leaflet-touch .leaflet-control-zoom-in{font-size:22px} .leaflet-touch .leaflet-control-zoom-out{font-size:24px} .leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px} -.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px} -.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px} +.leaflet-control-layers-toggle{background-image:url(../img/map/layers.png);width:36px;height:36px} +.leaflet-retina .leaflet-control-layers-toggle{background-image:url(../img/map/layers-2x.png);background-size:26px 26px} .leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px} .leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none} .leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative} diff --git a/searx/static/oscar/css/oscar.min.css b/searx/static/oscar/css/oscar.min.css index 5d2c24e6..1afd3e86 100644 --- a/searx/static/oscar/css/oscar.min.css +++ b/searx/static/oscar/css/oscar.min.css @@ -3,11 +3,15 @@ body{margin-bottom:80px} .footer{position:absolute;bottom:0;width:100%;height:60px} input[type=checkbox]:checked~.label_hide_if_checked{display:none} input[type=checkbox]:not(:checked)~.label_hide_if_not_checked{display:none} +.result_header{margin-bottom:5px;margin-top:20px}.result_header .favicon{margin-bottom:-3px} +.result_header a{vertical-align:bottom}.result_header a .highlight{font-weight:bold} +.result-content .highlight{font-weight:bold} .result-default{clear:both} .result-images{float:left !important} .img-thumbnail{margin:5px;max-height:128px;min-height:128px} .result-videos{clear:both} .result-torrents{clear:both} +.result-map{clear:both} .suggestion_item{margin:2px 5px} .result_download{margin-right:5px} #pagination{margin-top:30px;padding-bottom:50px} @@ -15,3 +19,4 @@ input[type=checkbox]:not(:checked)~.label_hide_if_not_checked{display:none} .infobox .infobox_part:last-child{margin-bottom:0} .search_categories{margin:10px 0;text-transform:capitalize} .cursor-text{cursor:text !important} +.cursor-pointer{cursor:pointer !important} diff --git a/searx/static/oscar/less/oscar/cursor.less b/searx/static/oscar/less/oscar/cursor.less index c7e3191d..cbc1ea6f 100644 --- a/searx/static/oscar/less/oscar/cursor.less +++ b/searx/static/oscar/less/oscar/cursor.less @@ -2,3 +2,7 @@ .cursor-text { cursor: text !important; } + +.cursor-pointer { + cursor: pointer !important; +} diff --git a/searx/static/oscar/less/oscar/results.less b/searx/static/oscar/less/oscar/results.less index 06c8a174..9ca2109b 100644 --- a/searx/static/oscar/less/oscar/results.less +++ b/searx/static/oscar/less/oscar/results.less @@ -1,3 +1,27 @@ + +.result_header { + margin-bottom:5px; + margin-top:20px; + + .favicon { + margin-bottom:-3px; + } + + a { + vertical-align: bottom; + + .highlight { + font-weight:bold; + } + } +} + +.result-content { + .highlight { + font-weight:bold; + } +} + // default formating of results .result-default { clear: both; @@ -24,6 +48,11 @@ clear: both; } +// map formating of results +.result-map { + clear: both; +} + // suggestion .suggestion_item { margin: 2px 5px; diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 8c4dd3ed..0acece9d 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -66,6 +66,6 @@ {% if autocomplete %}{% endif %} - --> + diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 018a29e0..3fe9b913 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -1,8 +1,11 @@ -

{% if result['favicon'] %} {% endif %}{{ result.title|safe }}

+{% from 'oscar/macros.html' import icon %} + +

{% if result['favicon'] %} {% endif %}{{ result.title|safe }}

{% if result.publishedDate %}{% endif %} +{{ icon('link') }} {{ _('cached') }} -{% if result.content %}

{{ result.content|safe }}

{% endif %} +{% if result.content %}

{{ result.content|safe }}

{% endif %}
diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index 578df459..c1b9e9b0 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -11,7 +11,7 @@