map.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
  2. {% from 'simple/icons.html' import icon_small %}
  3. {{ result_header(result, favicons, image_proxify) -}}
  4. {{- result_sub_header(result) -}}
  5. {%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%}
  6. <table>
  7. {%- if result.address -%}
  8. <tr>
  9. <th scope="row">{{ result.address_label or _('address') }}</th>
  10. <td itemscope itemtype="http://schema.org/PostalAddress">
  11. {%- if result.address.name -%}
  12. <strong itemprop="name" class="hidden">{{ result.address.name }}</strong>
  13. {%- endif -%}
  14. {% if result.address.road -%}
  15. <span itemprop="streetAddress">
  16. {%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %}
  17. {{- result.address.road -}}
  18. </span><br>
  19. {%- endif %}
  20. {%- if result.address.locality -%}
  21. <span itemprop="addressLocality">{{- result.address.locality -}}</span>
  22. {%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %}
  23. <br>
  24. {%- endif -%}
  25. {%- if result.address.country -%}
  26. <span itemprop="addressCountry">{{- result.address.country -}}</span>
  27. {%- endif -%}
  28. </td>
  29. </tr>
  30. {%- endif %}
  31. {%- for info in result.data -%}
  32. <tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr>
  33. {%- endfor -%}
  34. {%- for link in result.links -%}
  35. <tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td></tr>
  36. {%- endfor -%}
  37. </table>
  38. {%- if (result.latitude and result.longitude) or result.boundingbox -%}
  39. <small> <a class="btn-collapse collapsed searxng_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" 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 %}>{{ icon_small( 'globe-outline') }} {{ _('show map') }}</a></small>
  40. {%- endif -%}
  41. {{- result_sub_footer(result, proxify) -}}
  42. {% if (result.latitude and result.longitude) or result.boundingbox -%}
  43. <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" class="osm-map-box"></div></div>
  44. {%- endif %}
  45. {{- result_footer(result) }}