Main categories of OpenStreetBrowser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

232 lines
7.3 KiB

  1. <ul>
  2. {% set hasDescription = tagsPrefix(tags, 'description:') %}
  3. {% if tags.description or hasDescription %}
  4. <li class='hasSymbol'>
  5. <i class="fa fa-info" aria-hidden="true"></i>
  6. <span class='value'>{{ localizedTag(tags, 'description')|default(attribute(tags, 'description:' ~ hasDescription|keys[0]))|nl2br }}</span>
  7. </li>
  8. {% endif %}
  9. {% set address = tagsPrefix(tags, 'addr:') %}
  10. {% if address %}
  11. <li class='hasSymbol'>
  12. <i class="fa fa-map-marker" aria-hidden="true"></i>
  13. <span class='key'>{{ keyTrans('address') }}:</span>
  14. <span class='value'>
  15. {{ attribute(tags, 'addr:street') }}
  16. {{ attribute(tags, 'addr:housenumber') }},
  17. {{ attribute(tags, 'addr:postcode') }}
  18. {{ attribute(tags, 'addr:city') }}
  19. </span>
  20. </li>
  21. {% endif %}
  22. {% set address = tagsPrefix(tags, 'contact:') %}
  23. {% if address %}
  24. <li class='hasSymbol'>
  25. <i class="fa fa-map-marker" aria-hidden="true"></i>
  26. <span class='key'>{{ keyTrans('address') }}:</span>
  27. <span class='value'>
  28. {{ attribute(tags, 'contact:street') }}
  29. {{ attribute(tags, 'contact:housenumber') }},
  30. {{ attribute(tags, 'contact:postcode') }}
  31. {{ attribute(tags, 'contact:city') }}
  32. </span>
  33. </li>
  34. {% endif %}
  35. {% if attribute(tags, 'name:etymology') or attribute(tags, 'name:etymology:wikidata') %}
  36. <li class='hasSymbol'>
  37. <i class="fa fa-book" aria-hidden="true"></i>
  38. <span class='key'>{{ keyTrans('name:etymology') }}:</span>
  39. <span class='value'>
  40. {% set etymWikidata = attribute(tags, 'name:etymology:wikidata') %}
  41. {% if etymWikidata %}
  42. {% set etymWikidata = etymWikidata|split(';') %}
  43. {% set etymName = attribute(tags, 'name:etymology')|split(';') %}
  44. {% set result = [] %}
  45. {% for i in 0..max(etymName|length - 1, etymWikidata|length - 1) %}
  46. {% set result = result|merge([ etymWikidata[i] ? '<a target="_blank" href="https://wikidata.org/wiki/' ~ etymWikidata[i]|url_encode ~ '">' ~ (etymName[i]|default(etymWikidata[i]))|e ~ '</a>' : etymName[i]|e ]) %}
  47. {% endfor %}
  48. {{ result|enumerate|raw }}
  49. {% else %}
  50. {{ enumerate(attribute(tags, "name:etymology")) }}
  51. {% endif %}
  52. </span>
  53. </li>
  54. {% endif %}
  55. {% if tags.website %}
  56. <li class='hasSymbol'>
  57. <i class="fa fa-globe" aria-hidden="true"></i>
  58. <span class='key'>{{ keyTrans('website') }}:</span>
  59. <span class='value'>
  60. {% for i, v in tags.website|split(';') -%}
  61. {%- if i > 0 %}, {% endif %}
  62. <a target='_blank' href='{{ v|websiteUrl }}'>{{ v }}</a>
  63. {%- endfor %}
  64. </span>
  65. </li>
  66. {% endif %}
  67. {% if attribute(tags, 'contact:website') %}
  68. <li class='hasSymbol'>
  69. <i class="fa fa-globe" aria-hidden="true"></i>
  70. <span class='key'>{{ keyTrans('website') }}:</span>
  71. <span class='value'>
  72. {% for i, v in attribute(tags, 'contact:website')|split(';') -%}
  73. {%- if i > 0 %}, {% endif %}
  74. <a target='_blank' href='{{ v|websiteUrl }}'>{{ v }}</a>
  75. {%- endfor %}
  76. </span>
  77. </li>
  78. {% endif %}
  79. {% if tags.phone %}
  80. <li class='hasSymbol'>
  81. <i class="fa fa-phone" aria-hidden="true"></i>
  82. <span class='key'>{{ keyTrans('phone') }}:</span>
  83. <span class='value'>
  84. {% for i, v in tags.phone|split(';') -%}
  85. {%- if i > 0 %}, {% endif %}
  86. <a target='_blank' href='tel:{{ v }}'>{{ v }}</a>
  87. {%- endfor %}
  88. </span>
  89. </li>
  90. {% endif %}
  91. {% if attribute(tags, 'contact:phone') %}
  92. <li class='hasSymbol'>
  93. <i class="fa fa-phone" aria-hidden="true"></i>
  94. <span class='key'>{{ keyTrans('phone') }}:</span>
  95. <span class='value'>
  96. {% for i, v in attribute(tags, 'contact:phone')|split(';') -%}
  97. {%- if i > 0 %}, {% endif %}
  98. <a target='_blank' href='tel:{{ v }}'>{{ v }}</a>
  99. {%- endfor %}
  100. </span>
  101. </li>
  102. {% endif %}
  103. {% if attribute(tags, 'contact:email') or tags.email %}
  104. <li class='hasSymbol'>
  105. <i class="fa fa-user-circle" aria-hidden="true"></i>
  106. <span class='key'>{{ keyTrans('contact') }}:</span>
  107. <span class='value'>
  108. {% if attribute(tags, 'contact:email') %}
  109. {% for i, v in attribute(tags, 'contact:email')|split(';') -%}
  110. {%- if i > 0 %}, {% endif %}
  111. <a target='_blank' href='mailto:{{ v }}'>
  112. <i class="fa fa-envelope" aria-hidden="true"></i>
  113. </a>
  114. {%- endfor %}
  115. {% endif %}
  116. {% if attribute(tags, 'email') %}
  117. {% for i, v in tags.email|split(';') -%}
  118. {%- if i > 0 %}, {% endif %}
  119. <a target='_blank' href='mailto:{{ v }}'>
  120. <i class="fa fa-envelope" aria-hidden="true"></i>
  121. </a>
  122. {%- endfor %}
  123. {% endif %}
  124. </span>
  125. </li>
  126. {% endif %}
  127. {% if tags.opening_hours %}
  128. <li class='hasSymbol'>
  129. <i class="fa fa-clock-o" aria-hidden="true"></i>
  130. <span class='key'>{{ keyTrans('opening_hours') }}:</span>
  131. <span class='value'>
  132. {{ tags.opening_hours }}
  133. </span>
  134. </li>
  135. {% endif %}
  136. {% set payment = tagsPrefix(tags, 'payment:') %}
  137. {% if payment %}
  138. <li class='hasSymbol'>
  139. <i class="fa fa-money" aria-hidden="true"></i>
  140. <span class='key'>{{ keyTrans('payment') }}:</span>
  141. <span class='value'>
  142. {% set i = 0 %}
  143. {% for k, tag in payment %}
  144. {%- if i > 0 %},{% endif %}
  145. <span title="{{ tagTrans(k, tags[tag]) }}">{% if tags[tag] == 'no' %}<s>{{ keyTrans(tag, { default: k }) }}</s>{% else %}{{ keyTrans(tag, { default: k }) }}{% endif -%}</span>
  146. {% set i = i + 1 -%}
  147. {% endfor %}
  148. </span>
  149. </li>
  150. {% endif %}
  151. {% if attribute(tags, 'wheelchair') %}
  152. <li class='hasSymbol'>
  153. <i class="fa fa-info-circle" aria-hidden="true"></i>
  154. <span class='key'>{{ trans('facilities') }}:</span>
  155. <span class='value'>
  156. {% if attribute(tags, 'wheelchair') %}
  157. <i class="fa fa-wheelchair-alt {{ tags.wheelchair }}" aria-hidden="true" title='{{ keyTrans('wheelchair') }}: {{ tagTrans('wheelchair', tags.wheelchair) }}'></i>
  158. {% if attribute(tags, 'toilets:wheelchair') %}
  159. (<span class='{{ attribute(tags, 'toilets:wheelchair') }}' title='{{ keyTrans('toilets:wheelchair') }}: {{ tagTrans('toilets:wheelchair', attribute(tags, 'toilets:wheelchair')) }}'>&#128701;</span>)
  160. {% endif %}
  161. {% endif %}
  162. </span>
  163. </li>
  164. {% endif %}
  165. {% set wikipedia = null %}
  166. {% if attribute(tags, 'wikipedia') %}
  167. {% set wikipedia = tags.wikipedia|matches("^([^:]+):(.*)$") %}
  168. {% endif %}
  169. {% if not wikipedia %}
  170. {% for k, v in tags %}
  171. {% set m = k|matches("^wikipedia:(.*)$") %}
  172. {% if m %}
  173. {% set wikipedia = [ 0, m[1], v ] %}
  174. {% endif %}
  175. {% endfor %}
  176. {% endif %}
  177. {% if wikipedia %}
  178. <li class='hasSymbol'>
  179. <i class="fa fa-wikipedia-w" aria-hidden="true"></i>
  180. <span class='key'>{{ keyTrans('wikipedia') }}:</span>
  181. <span class='value'><a target='_blank' href="https://{{ wikipedia[1] }}.wikipedia.org/wiki/{{ wikipedia[2]|replace({ ' ': '_' }) }}">{{ wikipedia[2] }}</a></span>
  182. {% endif %}
  183. {% if tags.year_of_construction or tags.start_date or tags.opening_date or tags.end_date %}
  184. <li class='hasSymbol'>
  185. <i class="fa fa-clock-o" aria-hidden="true"></i>
  186. {% if tags.year_of_construction %}
  187. <span class='key'>{{ keyTrans('year_of_construction') }}:</span>
  188. <span class='value'>{{ tags.year_of_construction|osmFormatDate }}</span>
  189. <br/>
  190. {% endif %}
  191. {% if tags.start_date %}
  192. <span class='key'>{{ keyTrans('start_date') }}:</span>
  193. <span class='value'>{{ tags.start_date|osmFormatDate }}</span>
  194. <br/>
  195. {% endif %}
  196. {% if tags.opening_date %}
  197. <span class='key'>{{ keyTrans('opening_date') }}:</span>
  198. <span class='value'>{{ tags.opening_date|osmFormatDate }}</span>
  199. {% endif %}
  200. {% if tags.end_date %}
  201. <span class='key'>{{ keyTrans('end_date') }}:</span>
  202. <span class='value'>{{ tags.end_date|osmFormatDate }}</span>
  203. {% endif %}
  204. </li>
  205. {% endif %}
  206. </ul>