2021-12-22 04:03:28 +09:00
|
|
|
{% macro settings_details_element(title, summary, id, details_content, context, details_ids) %}
|
|
|
|
{% if details_ids is null %}
|
|
|
|
{% set details_ids = [id] %}
|
|
|
|
{% endif %}
|
2021-12-24 06:29:46 +09:00
|
|
|
<details class="section-settings-details" {{ open_details(context.open_details_query, details_ids) }} id={{ id }}>
|
2021-12-22 04:03:28 +09:00
|
|
|
<summary>
|
2021-12-24 06:29:46 +09:00
|
|
|
<strong class="section-settings-details-title">
|
2021-12-22 04:03:28 +09:00
|
|
|
{{ title | trans }}
|
2021-12-24 06:29:46 +09:00
|
|
|
</strong>
|
2021-12-22 04:03:28 +09:00
|
|
|
<em>
|
|
|
|
{{ summary | trans }}
|
|
|
|
</em>
|
|
|
|
</summary>
|
|
|
|
|
|
|
|
{% if details_content is instanceof('Twig\\Markup') %}
|
|
|
|
{{ details_content }}
|
|
|
|
{% else %}
|
|
|
|
{{ form(details_content) }}
|
|
|
|
{% endif %}
|
|
|
|
</details>
|
|
|
|
{% endmacro settings_details_element %}
|
|
|
|
|
|
|
|
{% macro settings_details_container(title, summary, container_id, tabs, context) %}
|
|
|
|
{% set children_ids = [container_id] %}
|
|
|
|
{% set details_content %}
|
|
|
|
<nav class='section-settings-nav'>
|
|
|
|
<ul>
|
|
|
|
{% for tab in tabs %}
|
|
|
|
<hr>
|
|
|
|
<li>
|
|
|
|
{% set content %}
|
|
|
|
{% if tab['controller'] is defined %}
|
|
|
|
{% include tab['controller']['_template'] with tab['controller'] only %}
|
|
|
|
{% else %}
|
|
|
|
{{ form(tab['form']) }}
|
|
|
|
{% endif %}
|
|
|
|
{% endset %}
|
|
|
|
{{ _self.settings_details_element(tab['title'], tab['desc'], tab['id'] ~ '-details', content, context) }}
|
|
|
|
{% set children_ids = children_ids|merge([tab['id'] ~ '-details']) %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{% endset %}
|
|
|
|
{{ _self.settings_details_element(title, summary, container_id, details_content, context, children_ids) }}
|
|
|
|
{% endmacro settings_details_container %}
|