From b3d1aa5f7f0edcbf5f52d88a7a13e944b0f36822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 5 Sep 2024 10:11:07 +0200 Subject: [PATCH] Support multi-values for email, website, phone (and contact:...) --- detailsBody.html | 35 +++++++++++++++++++++++++---------- popupBody.html | 30 ++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/detailsBody.html b/detailsBody.html index 56daf12..9c43f94 100644 --- a/detailsBody.html +++ b/detailsBody.html @@ -48,7 +48,10 @@ {{ keyTrans('website') }}: - {{ tags.website }} + {% for i, v in tags.website|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -58,7 +61,10 @@ {{ keyTrans('website') }}: - {{ attribute(tags, 'contact:website') }} + {% for i, v in attribute(tags, 'contact:website')|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -68,7 +74,10 @@ {{ keyTrans('phone') }}: - {{ tags.phone }} + {% for i, v in tags.phone|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -78,19 +87,24 @@ {{ keyTrans('phone') }}: - {{ attribute(tags, 'contact:phone') }} + {% for i, v in attribute(tags, 'contact:phone')|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} + {% if attribute(tags, 'contact:email') %}
  • {{ keyTrans('email') }}: - - {{ attribute(tags, 'contact:email') }} - + {% for i, v in attribute(tags, 'contact:email')|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %}
  • {% endif %} @@ -100,9 +114,10 @@ {{ keyTrans('email') }}: - - {{ attribute(tags, 'email') }} - + {% for i, v in tags.email|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} diff --git a/popupBody.html b/popupBody.html index 9ec1368..1aa1344 100644 --- a/popupBody.html +++ b/popupBody.html @@ -48,7 +48,10 @@ {{ keyTrans('website') }}: - {{ tags.website }} + {% for i, v in tags.website|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -58,7 +61,10 @@ {{ keyTrans('website') }}: - {{ attribute(tags, 'contact:website') }} + {% for i, v in attribute(tags, 'contact:website')|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -68,7 +74,10 @@ {{ keyTrans('phone') }}: - {{ tags.phone }} + {% for i, v in tags.phone|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -78,7 +87,10 @@ {{ keyTrans('phone') }}: - {{ attribute(tags, 'contact:phone') }} + {% for i, v in attribute(tags, 'contact:phone')|split(';') -%} + {%- if i > 0 %}, {% endif %} + {{ v }} + {%- endfor %} {% endif %} @@ -90,15 +102,21 @@ {% if attribute(tags, 'contact:email') %} - + {% for i, v in attribute(tags, 'contact:email')|split(';') -%} + {%- if i > 0 %}, {% endif %} + + {%- endfor %} {% endif %} {% if attribute(tags, 'email') %} - + {% for i, v in tags.email|split(';') -%} + {%- if i > 0 %}, {% endif %} + + {%- endfor %} {% endif %}