feat: insurance info urls in tooltips

This commit is contained in:
Björn Fromme
2025-10-02 17:28:53 +02:00
parent 8984b2edd5
commit 8e43edcbaf
2 changed files with 61 additions and 51 deletions
@@ -195,6 +195,7 @@
} }
}) }} }) }}
<div class="col-span-2">
{# Insurance field OR assigned insurance display for dependent participants #} {# Insurance field OR assigned insurance display for dependent participants #}
{% set participantData = participant.vars.data %} {% set participantData = participant.vars.data %}
{% set showBulkInsurance = loop.index > 1 and form.vars.data.participants[0].bulkInsuranceBooking %} {% set showBulkInsurance = loop.index > 1 and form.vars.data.participants[0].bulkInsuranceBooking %}
@@ -239,6 +240,8 @@
{% endif %} {% endif %}
</div> </div>
</div>
{# Transportation Services Section #} {# Transportation Services Section #}
<div class="mt-6 border-t pt-4"> <div class="mt-6 border-t pt-4">
<h3 class="font-semibold text-lg mb-4">Anreise</h3> <h3 class="font-semibold text-lg mb-4">Anreise</h3>
+22 -15
View File
@@ -212,23 +212,30 @@
{%- endif -%} {%- endif -%}
{%- set insurance = insurances[child.vars.value] ?? null -%} {%- set insurance = insurances[child.vars.value] ?? null -%}
{%- if insurance is not null -%} {%- set urlsProductInfo = insurance is not null ? insurance.getAllUrlsProductInfo() : [] -%}
{%- set urlsInfo = insurance.getAllUrlsInfo() -%}
{%- set urlsProductInfo = insurance.getAllUrlsProductInfo() -%}
{%- set urlsTerms = insurance.getAllUrlsTerms() -%}
{%- if urlsInfo is not empty -%}
{%- set child_attr = child_attr|merge({'data-urls-info': urlsInfo|json_encode}) -%}
{%- endif -%}
{%- if urlsProductInfo is not empty -%}
{%- set child_attr = child_attr|merge({'data-urls-product-info': urlsProductInfo|json_encode}) -%}
{%- endif -%}
{%- if urlsTerms is not empty -%}
{%- set child_attr = child_attr|merge({'data-urls-terms': urlsTerms|json_encode}) -%}
{%- endif -%}
{%- endif -%}
<div class="flex gap-2">
{{- form_row(child, { 'attr': child_attr }) -}} {{- form_row(child, { 'attr': child_attr }) -}}
{%- if urlsProductInfo is not empty -%}
<div class="flex flex-col justify-center" {{ stimulus_controller('tooltip') }}>
<button type="button" data-tooltip-target="trigger" class="text-blue-600 hover:text-blue-800">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" />
</svg>
</button>
<template data-tooltip-target="template">
<div class="text-sm">
{%- for url in urlsProductInfo -%}
<a href="{{ url }}" target="_blank" rel="noopener noreferrer" class="block">
Produktinformation {{ loop.index }}
</a>
{%- endfor -%}
</div>
</template>
</div>
{%- endif -%}
</div>
{% endfor -%} {% endfor -%}
{%- else -%} {%- else -%}
{{- parent() -}} {{- parent() -}}