feat: extended insurance parsing, pass info urls to view
This commit is contained in:
@@ -193,3 +193,44 @@
|
||||
</div>
|
||||
</div>
|
||||
{%- endblock multiselect_widget -%}
|
||||
|
||||
{% block insurance_choice_widget %}
|
||||
{%- if expanded -%}
|
||||
{%- for child in form %}
|
||||
{%- set child_attr = {} -%}
|
||||
|
||||
{%- if attr['hx-trigger'] is defined -%}
|
||||
{%- set child_attr = child_attr|merge({
|
||||
'hx-trigger': attr['hx-trigger'],
|
||||
'hx-post': attr['hx-post'],
|
||||
'hx-swap': attr['hx-swap']
|
||||
}) -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if child.vars.attr is defined -%}
|
||||
{%- set child_attr = child_attr|merge(child.vars.attr) -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set insurance = insurances[child.vars.value] ?? null -%}
|
||||
{%- if insurance is not null -%}
|
||||
{%- 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 -%}
|
||||
|
||||
{{- form_row(child, { 'attr': child_attr }) -}}
|
||||
{% endfor -%}
|
||||
{%- else -%}
|
||||
{{- parent() -}}
|
||||
{%- endif -%}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user