map.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl, icon %}
  2. {{ result_header(result, favicons, image_proxify) -}}
  3. {{- result_sub_header(result) -}}
  4. {%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%}
  5. <table>
  6. {%- if result.address -%}
  7. <tr>
  8. <th scope="row">{{ result.address_label or _('address') }}</th>
  9. <td itemscope itemtype="http://schema.org/PostalAddress">
  10. {%- if result.address.name -%}
  11. <strong itemprop="name" class="hidden">{{ result.address.name }}</strong>
  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. </td>
  28. </tr>
  29. {%- endif %}
  30. {%- for info in result.data -%}
  31. <tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr>
  32. {%- endfor -%}
  33. {%- for link in result.links -%}
  34. <tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url|safe }}</a></td></tr>
  35. {%- endfor -%}
  36. </table>
  37. {%- if (result.latitude and result.longitude) or result.boundingbox -%}
  38. <small> <a class="btn-collapse collapsed searx_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( 'globe') }} {{ _('show map') }}</a></small>
  39. {%- endif -%}
  40. {{- result_sub_footer(result, proxify) -}}
  41. {% if (result.latitude and result.longitude) or result.boundingbox -%}
  42. <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div>
  43. {%- endif %}
  44. {{- result_footer(result) }}