summaryrefslogtreecommitdiff
path: root/searx/templates/oscar/result_templates/map.html
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-11-02 13:00:28 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-11-02 13:00:28 +0100
commit740594a4b73952ad3f5fa52dd1bb939c73dcc7c2 (patch)
tree07966947a2c61b7de99b9c52cd1bd4eebcc85759 /searx/templates/oscar/result_templates/map.html
parentb4829891f93515c7d19af2472a855eccd7807c4a (diff)
[enh] oscar_template: initial osm-map support for map results
* TODO: remove leaflet.min.css if not required
Diffstat (limited to 'searx/templates/oscar/result_templates/map.html')
-rw-r--r--searx/templates/oscar/result_templates/map.html18
1 files changed, 18 insertions, 0 deletions
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 @@
+<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>
+
+{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
+
+{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+
+{% if result.latitude and result.longitude %}
+ <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>
+
+ <div class="collapse" id="result-map-{{ index }}">
+ <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
+ </div>
+{% endif %}
+
+<div class="clearfix"></div>
+
+<span class="label label-default pull-right">{{ result.engine }}</span>
+<p class="text-muted">{{ result.pretty_url }}</p>