From 740594a4b73952ad3f5fa52dd1bb939c73dcc7c2 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sun, 2 Nov 2014 13:00:28 +0100 Subject: [enh] oscar_template: initial osm-map support for map results * TODO: remove leaflet.min.css if not required --- searx/templates/oscar/result_templates/map.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 searx/templates/oscar/result_templates/map.html (limited to 'searx/templates/oscar/result_templates/map.html') diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html new file mode 100644 index 000000000..3385f5ba7 --- /dev/null +++ b/searx/templates/oscar/result_templates/map.html @@ -0,0 +1,18 @@ +

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

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

{{ result.content|safe }}

{% endif %} + +{% if result.latitude and result.longitude %} + + +
+
+
+{% endif %} + +
+ +{{ result.engine }} +

{{ result.pretty_url }}

-- cgit v1.2.3 From 2e7723a6c1ce51c6b3830470164ac818126760ae Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Mon, 3 Nov 2014 10:39:47 +0100 Subject: [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/templates/oscar/result_templates/map.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'searx/templates/oscar/result_templates/map.html') diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 3385f5ba7..45aa76356 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -1,12 +1,16 @@ -

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

+{% from 'oscar/macros.html' import icon %} -{% if result.publishedDate %}{% endif %} - -{% if result.content %}

{{ result.content|safe }}

{% endif %} +

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

-{% if result.latitude and result.longitude %} - +{% if result.publishedDate %}{% endif %} +{{ icon('link') }} {{ _('cached') }} +{% if (result.latitude and result.longitude) or result.boundingbox %} + +{% endif %} + +{% if result.content %}

{{ result.content|safe }}

{% endif %} +{% if (result.latitude and result.longitude) or result.boundingbox %}
-- cgit v1.2.3 From c38917bb2a472429f78cd00fffb5e7057ceecc02 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Mon, 3 Nov 2014 18:46:58 +0100 Subject: [enh] template_oscar: show addressdata if possible --- searx/templates/oscar/result_templates/map.html | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'searx/templates/oscar/result_templates/map.html') diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 45aa76356..2c1e549e3 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -7,7 +7,29 @@ {% if (result.latitude and result.longitude) or result.boundingbox %} {% endif %} - + +{% if result.address %} +

+ {% if result.address.name %} + {{ result.address.name }}
+ {% endif %} + {% if result.address.road %} + + {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %} + {{ result.address.road }} +
+ {% endif %} + {% if result.address.locality %} + {{ result.address.locality }}, + {% if result.address.postcode %} {{ result.address.postcode }}{% endif %} +
+ {% endif %} + {% if result.address.country %} + {{ result.address.country }} + {% endif %} +

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

{{ result.content|safe }}

{% endif %} {% if (result.latitude and result.longitude) or result.boundingbox %} -- cgit v1.2.3 From 46dd502592f5ad09fab761c9311065b72ee3e55d Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Tue, 4 Nov 2014 12:58:12 +0100 Subject: [fix][template][oscar] print ',' only if postcode is found --- searx/templates/oscar/result_templates/map.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'searx/templates/oscar/result_templates/map.html') diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 2c1e549e3..a7c37dd59 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -20,8 +20,8 @@
{% endif %} {% if result.address.locality %} - {{ result.address.locality }}, - {% if result.address.postcode %} {{ result.address.postcode }}{% endif %} + {{ result.address.locality }} + {% if result.address.postcode %}, {{ result.address.postcode }}{% endif %}
{% endif %} {% if result.address.country %} -- cgit v1.2.3 From 4b75d41f864b9d127aa88c962b7ce849ee3b0b51 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Wed, 19 Nov 2014 14:59:30 +0100 Subject: [enh][oscar_template] loading map informations from overpass-api --- searx/templates/oscar/result_templates/map.html | 36 ++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'searx/templates/oscar/result_templates/map.html') diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index a7c37dd59..531146dc6 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -3,13 +3,25 @@

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

{% if result.publishedDate %}{% endif %} + {{ icon('link') }} {{ _('cached') }} + {% if (result.latitude and result.longitude) or result.boundingbox %} {% endif %} +{% if result.osm and (result.osm.type and result.osm.id) %} + +{% endif %} + +{# {% if (result.latitude and result.longitude) %} + +{% endif %} #} + +
+ {% if result.address %} -

+

{% if result.address.name %} {{ result.address.name }}
{% endif %} @@ -27,11 +39,29 @@ {% if result.address.country %} {{ result.address.country }} {% endif %} -

+

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

{{ result.content|safe }}

{% endif %} +{% if result.osm and (result.osm.type and result.osm.id) %} +
+
Loading ...
+ + + +
+{% endif %} + +{# {% if (result.latitude and result.longitude) %} +
+ Longitude: {{ result.longitude }}
+ Latitude: {{ result.latitude }} +
+{% endif %} #} + +{% if result.content %}

{{ result.content|safe }}

{% endif %} +
+ {% if (result.latitude and result.longitude) or result.boundingbox %}
-- cgit v1.2.3