map.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% from 'oscar/macros.html' import icon %}
  2. <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>
  3. {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
  4. <small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
  5. {% if (result.latitude and result.longitude) or result.boundingbox %}
  6. <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>
  7. {% endif %}
  8. {% if result.address %}
  9. <p class="result-content result-adress" itemscope itemtype="http://schema.org/PostalAddress">
  10. {% if result.address.name %}
  11. <strong itemprop="name">{{ result.address.name }}</strong><br/>
  12. {% endif %}
  13. {% if result.address.road %}
  14. <span itemprop="streetAddress">
  15. {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
  16. {{ result.address.road }}
  17. </span><br/>
  18. {% endif %}
  19. {% if result.address.locality %}
  20. <span itemprop="addressLocality">{{ result.address.locality }}</span>,
  21. {% if result.address.postcode %} <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
  22. <br/>
  23. {% endif %}
  24. {% if result.address.country %}
  25. <span itemprop="addressCountry">{{ result.address.country }}</span>
  26. {% endif %}
  27. </p><div class="clearfix"></div>
  28. {% endif %}
  29. {% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
  30. {% if (result.latitude and result.longitude) or result.boundingbox %}
  31. <div class="collapse" id="result-map-{{ index }}">
  32. <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
  33. </div>
  34. {% endif %}
  35. <div class="clearfix"></div>
  36. <span class="label label-default pull-right">{{ result.engine }}</span>
  37. <p class="text-muted">{{ result.pretty_url }}</p>