Skip to content

Fix missing theme variable in block calls for proper theme inheritance #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/Resources/views/themes/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
data-controller="{{ stimulus_controllers|join(' ') }}"
data-kreyu--data-table-bundle--state-url-query-parameters-value="{{ url_query_parameters|default({})|json_encode }}"
>
{{ block('action_bar') }}
{{ block('table') }}
{{ block('action_bar', theme) }}
{{ block('table', theme) }}

{% if pagination_enabled %}
{{ data_table_pagination(pagination) }}
Expand All @@ -38,10 +38,10 @@
data-controller="{{ stimulus_controllers|join(' ') }}"
data-kreyu--data-table-bundle--state-url-query-parameters-value="{{ url_query_parameters|default({})|json_encode }}"
>
{{ block('action_bar') }}
{{ block('action_bar', theme) }}

{{ form_start(form, form_variables) }}
{{ block('table') }}
{{ block('table', theme) }}
{{ form_end(form, { render_rest: false }) }}

{% if pagination_enabled %}
Expand All @@ -52,39 +52,39 @@
{% endblock %}

{% block kreyu_data_table_table %}
{{ block('table') }}
{{ block('table', theme) }}
{% endblock %}

{% block kreyu_data_table_action_bar %}
{{ block('action_bar') }}
{{ block('action_bar', theme) }}
{% endblock %}

{% block action_bar %}{% endblock %}

{% block table %}
<table {% with { attr: table_attr|default({}) } %}{{- block('attributes') -}}{% endwith %}>
{{ block('table_head') }}
{{ block('table_body') }}
{{ block('table_head', theme) }}
{{ block('table_body', theme) }}
</table>
{% endblock %}

{% block table_head %}
<thead>{{ block('table_head_row') }}</thead>
<thead>{{ block('table_head_row', theme) }}</thead>
{% endblock %}

{% block table_head_row %}
{{ data_table_header_row(header_row) }}
{% endblock %}

{% block table_body %}
<tbody>{{ block('table_body_row') }}</tbody>
<tbody>{{ block('table_body_row', theme) }}</tbody>
{% endblock %}

{% block table_body_row %}
{% if value_rows|length > 0 %}
{{ block('table_body_row_results') }}
{{ block('table_body_row_results', theme) }}
{% else %}
{{ block('table_body_row_no_results') }}
{{ block('table_body_row_no_results', theme) }}
{% endif %}
{% endblock %}

Expand Down