Skip to content

Commit

Permalink
UHF-9298: Moved the other info accordion inside if statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
dire committed Nov 10, 2023
1 parent 540dbfa commit cae5f7c
Showing 1 changed file with 56 additions and 58 deletions.
114 changes: 56 additions & 58 deletions templates/module/helfi_tpr/tpr-unit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -96,65 +96,63 @@
component_content_class: 'accordion',
}
%}
{% block component_content %}

{% if has_prices %}
{% set accordion_content %}

{% embed "@hdbt/misc/component.twig" with { component_classes: [ 'component--paragraph-text' ] } %}
{% block component_content %}
{{ content.price_info }}
{% endblock component_content %}
{% endembed %}

{% endset %}

{% include '@hdbt/component/accordion.twig' ignore missing with {
heading_level: 'h2',
heading: 'Charges'|t({}, {'context': 'TPR Unit tpr data accordion heading'}),
content: accordion_content,
} %}
{% endif %}

{% if has_contacts %}
{% set contacts_accordion_content %}

{% embed "@hdbt/misc/component.twig" with { component_classes: [ 'component--paragraph-text' ] } %}
{% block component_content %}
{{ content.contacts }}
{% endblock component_content %}
{% endembed %}

{% endset %}

{% include '@hdbt/component/accordion.twig' ignore missing with {
heading_level: 'h2',
heading: 'Other contact information'|t({}, {'context': 'TPR Unit tpr data accordion heading'}) ,
content: contacts_accordion_content,
} %}
{% endif %}
{% block component_content %}
{% if has_prices %}
{% set accordion_content %}

{% embed "@hdbt/misc/component.twig" with { component_classes: [ 'component--paragraph-text' ] } %}
{% block component_content %}
{{ content.price_info }}
{% endblock component_content %}
{% endembed %}

{% endset %}

{% include '@hdbt/component/accordion.twig' ignore missing with {
heading_level: 'h2',
heading: 'Charges'|t({}, {'context': 'TPR Unit tpr data accordion heading'}),
content: accordion_content,
} %}
{% endif %}

{% if has_contacts %}
{% set contacts_accordion_content %}

{% embed "@hdbt/misc/component.twig" with { component_classes: [ 'component--paragraph-text' ] } %}
{% block component_content %}
{{ content.contacts }}
{% endblock component_content %}
{% endembed %}

{% endset %}

{% include '@hdbt/component/accordion.twig' ignore missing with {
heading_level: 'h2',
heading: 'Other contact information'|t({}, {'context': 'TPR Unit tpr data accordion heading'}) ,
content: contacts_accordion_content,
} %}
{% endif %}

{% if has_other_info %}
{% set other_info_accordion_content %}

{% embed "@hdbt/misc/component.twig" with { component_classes: [ 'component--paragraph-text' ] } %}
{% block component_content %}
{{ content.highlights }}
{{ content.topical }}
{{ content.other_info }}
{{ content.links }}
{% endblock component_content %}
{% endembed %}

{% endset %}
{% endif %}

{% include '@hdbt/component/accordion.twig' ignore missing with {
heading_level: 'h2',
heading: 'Further information'|t({}, {'context': 'TPR Unit tpr data accordion heading'}),
content: other_info_accordion_content,
} %}

{% if has_other_info %}
{% set other_info_accordion_content %}

{% embed "@hdbt/misc/component.twig" with { component_classes: [ 'component--paragraph-text' ] } %}
{% block component_content %}
{{ content.highlights }}
{{ content.topical }}
{{ content.other_info }}
{{ content.links }}
{% endblock component_content %}
{% endembed %}

{% endset %}

{% include '@hdbt/component/accordion.twig' ignore missing with {
heading_level: 'h2',
heading: 'Further information'|t({}, {'context': 'TPR Unit tpr data accordion heading'}),
content: other_info_accordion_content,
} %}
{% endif %}
{% endblock component_content %}
{% endembed %}
{% endif %}
Expand Down

0 comments on commit cae5f7c

Please sign in to comment.