{% extends '@KreyuDataTable/themes/base.html.twig' %} {# Bootstrap 5 Theme #} {# @see https://getbootstrap.com/docs/5.0/ #} {% block table %}
{% with { table_attr: { class: 'table table-hover align-middle mb-0' }|merge(table_attr|default({})) } %} {{ parent() }} {% endwith %}
{% endblock %} {% block column_header %} {% with { active_attr: { class: 'border-bottom border-primary text-primary' }, label_attr: { class: 'text-decoration-none text-reset d-block w-100 h-100 py-1' }, } %} {{ parent() }} {% endwith %} {% endblock %} {% block action_bar %} {% set display_filter_action = filtration_enabled and filters|length > 0 and filtration_form.children|length > 0 %} {% set display_export_action = exporting_enabled and exporters|length > 0 %} {% if title or has_active_filters or display_filter_action or display_export_action or personalization_enabled %}
{% if translation_domain is not same as false %} {{ title|trans(title_translation_parameters, translation_domain) }} {% else %} {{ title }} {% endif %}
{#{% if filtration_enabled and filtration_form and filtration_form.vars.search_fields|length > 0 %}
{{ block('action_search') }}
{% endif %}#} {% for action in actions %}
{{ data_table_action(action) }}
{% endfor %} {#{% if display_filter_action %}
{{ block('action_filter') }}
{% endif %}#} {% if display_export_action %}
{{ block('action_export') }} {{ block('export_modal') }}
{% endif %} {% if personalization_enabled %}
{{ block('action_personalize') }} {{ block('personalization_modal') }}
{% endif %}
{#{% if filtration_enabled and filtration_form and filters|length > 0 %}
{{ data_table_filters_form(filtration_form) }}
{% endif %}#} {% if has_active_filters %}
{{ block('active_filters') }}
{% endif %} {% endif %} {% if has_batch_actions %} {{ block('batch_action_bar', theme) }} {% endif %} {% endblock %} {% block batch_action_bar %} {% endblock %} {% block batch_action_bar_title %} {% set wrapper_attr = { class: 'card-title fs-6 fw-normal text-muted mb-0' }|merge(wrapper_attr|default({})) %}
{{ 'Selected'|trans({}, 'KreyuDataTable') }}: 0
{% endblock %} {% block batch_action_bar_actions %}
{% for action in batch_actions %}
{{ data_table_action(action) }}
{% endfor %}
{% endblock %} {% block action_search %} {% form_theme filtration_form with [_self, 'bootstrap_5_layout.html.twig'] %}
{% for child in filtration_form.vars.search_fields %} {{ form_widget(child.value, { attr: { form: filtration_form.vars.id } }) }} {% endfor %}
{% endblock %} {% block action_filter %} {% set attr = { 'class': 'btn btn-primary', 'type': 'button', 'data-bs-toggle': 'collapse', 'data-bs-target': '#' ~ filtration_form.vars.id ~ '__collapse', 'aria-expanded': 'false', 'aria-controls': filtration_form.vars.id ~ '__collapse', 'title': 'Filter'|trans({}, 'KreyuDataTable'), }|merge(attr|default({})) %} {% endblock %} {% block action_filter_icon %} {% endblock %} {% block action_export %} {% set attr = { 'class': 'btn btn-primary', 'type': 'button', 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ export_form.vars.id ~ '__modal', 'title': 'Export'|trans({}, 'KreyuDataTable'), }|merge(attr|default({})) %} {% endblock %} {% block action_export_icon %} {% endblock %} {% block action_personalize %} {% set attr = { 'class': 'btn btn-primary', 'type': 'button', 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ personalization_form.vars.id ~ '__modal', 'title': 'Personalize'|trans({}, 'KreyuDataTable'), }|merge(attr|default({})) %} {% endblock %} {% block action_personalize_icon %} {% endblock %} {% block filter_clear_button_icon '×' %} {% block filter_clear_all_button_icon %} {% endblock %} {% block filter_clear_all_button %} {% set attr = { 'class': 'btn btn-icon btn-outline-danger', 'href': data_table_filter_clear_url(data_table, filters), 'data-toggle': 'tooltip', 'data-placement': 'bottom', 'title': 'Clear all filters'|trans({}, 'KreyuDataTable'), 'data-turbo-action': 'advance', 'data-turbo-frame': '_self', }|merge(attr|default({})) %} {{ block('filter_clear_all_button_icon') }} {% endblock %} {% block filter_clear_button %} {% set attr = { 'class': 'btn px-2', 'href': data_table_filter_clear_url(data_table, filter), 'data-toggle': 'tooltip', 'data-placement': 'bottom', 'title': 'Clear filter'|trans({}, 'KreyuDataTable'), 'data-turbo-action': 'advance', 'data-turbo-frame': '_self', }|merge(attr|default({})) %} {{ filter.vars.label|trans({}, filter.vars.translation_domain) }} {% if filter.vars.operator_selectable %} {{ filter.vars.data.operator.label|trans({}, 'KreyuDataTable') }} {% endif %} {% if filter.vars.value is iterable %} {% for value in filter.vars.value %} {%- if filter.vars.translation_domain is not same as false -%} {{ value|trans({}, filter.vars.translation_domain) }} {%- else -%} {{ filter.vars.value }} {%- endif -%} {{- not loop.last ? ', ' }} {% endfor %} {% elseif filter.vars.translation_domain is not same as false %} {{ filter.vars.value|trans({}, filter.vars.translation_domain) }} {% else %} {{ filter.vars.value }} {% endif %} {% endblock %} {% block active_filters %}
{% if has_active_filters %} {{ block('filter_clear_all_button') }} {% endif %} {% for filter_name, filter_data in filtration_data.filters|default([])|filter(filter => filter.hasValue()) %} {% with { filter: filters[filter_name] } %} {{ block('filter_clear_button') }} {% endwith %} {% endfor %}
{% endblock %} {# Filtration #} {% block kreyu_data_table_filters_form %} {% with { form_themes: [_self, 'bootstrap_5_layout.html.twig'] } %} {{ parent() }} {% endwith %} {% endblock %} {% block filtration_form_content %} {% with { attr: { class: 'row' } } %} {{ parent() }} {% endwith %} {% endblock %} {% block filtration_form_row %} {% with { attr: { class: 'col-12 col-md-6 col-lg-3' }, form_themes: [_self, 'bootstrap_5_layout.html.twig'] } %} {{ parent() }} {% endwith %} {% endblock %} {% block filtration_form_submit %}
 
{% with { attr: { class: 'btn btn-primary' } } %} {{ parent() }} {% endwith %}
{% endblock %} {# Personalization #} {% block kreyu_data_table_personalization_form %} {% form_theme form with [_self, 'bootstrap_5_layout.html.twig'] %}
{{ form_start(form, { attr: { 'data-turbo-frame': '_self' } }) }} {% if form._token is defined %} {{ form_row(form._token) }} {% endif %} {{ block('personalization_form_help') }}
{{ block('personalization_form_columns') }}
{{ block('personalization_form_submit') }} {{ form_end(form) }}
{% endblock %} {% block personalization_form_help %}
{{ 'Drag items between columns to show/hide relevant data in the list or change their order'|trans({}, 'KreyuDataTable') }}
{% endblock %} {% block personalization_form_columns %} {{ block('personalization_form_visible_columns') }} {{ block('personalization_form_hidden_columns') }} {% endblock %} {% block personalization_form_visible_columns %}
{{ 'Visible columns'|trans({}, 'KreyuDataTable') }}
{% endblock %} {% block personalization_form_hidden_columns %}
{{ 'Hidden columns'|trans({}, 'KreyuDataTable') }}
{% endblock %} {% block personalization_form_submit %}
{% endblock %} {% block personalization_modal %} {% endblock %} {% block kreyu_data_table_export_form %} {% form_theme form with [_self, 'bootstrap_5_layout.html.twig'] %}
{{ form_start(form) }}
{{ form_row(form.filename) }}
{{ form_row(form.exporter) }}
{{ form_row(form.strategy) }}
{{ form_row(form.includePersonalization) }}
{{ form_end(form) }}
{% endblock %} {% block export_modal %} {% endblock %} {% block pagination_widget %} {% endblock %} {% block pagination_counters %}
{{ parent() }}
{% endblock %} {% block pagination_controls %}
{{ parent() }}
{% endblock %} {% block pagination_per_page %}
{{ parent() }}
{% endblock %} {% block pagination_per_page_message %}
{{ parent() }}
{% endblock %} {% block pagination_per_page_form %} {% with { select_attr: { class: 'col form-select' } } %} {{ parent() }} {% endwith %} {% endblock %} {% block pagination_page %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_page_active %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_first %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_first_disabled %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_previous %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_previous_disabled %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_last %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_last_disabled %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_next %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block pagination_next_disabled %}
{% with { attr: { class: 'page-link' } } %} {{ parent() }} {% endwith %}
{% endblock %} {% block kreyu_data_table_filter_data_row %}
{{ form_label(form) }}
{% if form.operator is defined %} {{ form_widget(form.operator) }} {% endif %} {{ form_widget(form.value) }}
{% endblock %} {% block kreyu_data_table_personalization_column_data_label %} {% endblock %} {% block kreyu_data_table_personalization_column_data_row %}
  • {{ form_label(form) }} {{ form_widget(form.name) }} {{ form_widget(form.priority) }} {{ form_widget(form.visible) }}
  • {% endblock %} {% block action_control_icon %} {% endblock %} {% block action_confirmation_modal %} {% set modal_status_color_class = { 'info': 'primary', 'warning': 'warning', 'danger': 'danger', }[confirmation.type] %} {% endblock %} {% block action_link_control -%} {% set attr = attr|merge({ class: ('btn btn-link d-inline-flex align-items-center gap-2 text-decoration-none ' ~ attr.class|default(''))|trim }) %} {% if confirmation %} {% set attr = { 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ confirmation.identifier, }|merge(attr) %} {% set confirm_button_attr = { href }|merge(confirm_button_attr|default({})) %} {% if batch %} {% set confirm_button_attr = { 'data-kreyu--data-table-bundle--batch-target': 'identifierHolder', }|merge(confirm_button_attr) %} {% endif %} {% with { attr, confirm_button_attr } %}{{ block('action_confirmation_modal') }}{% endwith %} {% endif %} {{ parent() }} {%- endblock %} {# @see Kreyu\Bundle\DataTableBundle\Action\Type\ButtonActionType #} {% block action_button_control -%} {% set attr = attr|merge({ class: ('btn btn-primary d-inline-flex align-items-center gap-2 ' ~ attr.class|default(''))|trim }) %} {% set icon_attr = icon_attr|merge({ class: ('lh-base ' ~ icon_attr.class|default(''))|trim }) %} {% if confirmation %} {% set attr = { 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ confirmation.identifier, }|merge(attr) %} {% set confirm_button_attr = { href }|merge(confirm_button_attr|default({})) %} {% if batch %} {% set confirm_button_attr = { 'data-kreyu--data-table-bundle--batch-target': 'identifierHolder', }|merge(confirm_button_attr) %} {% endif %} {% with { attr, confirm_button_attr } %}{{ block('action_confirmation_modal') }}{% endwith %} {% endif %} {{ parent() }} {%- endblock %} {# @see Kreyu\Bundle\DataTableBundle\Action\Type\FormActionType #} {% block action_form_control -%} {% set attr = attr|merge({ class: ('d-inline-block ' ~ attr.class|default(''))|trim }) %} {% set button_attr = button_attr|merge({ class: ('btn btn-primary ' ~ button_attr.class|default(''))|trim }) %} {% if confirmation %} {% with { button_tag: 'a', button_attr: { 'type': 'button', 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ confirmation.identifier, }|merge(button_attr) } %} {{ parent() }} {% endwith %} {% with { confirm_button_tag: 'button', confirm_button_attr: { type: 'submit', form: form_id } } %} {{ block('action_confirmation_modal') }} {% endwith %} {% else %} {{ parent() }} {% endif %} {%- endblock %} {# @see Kreyu\Bundle\DataTableBundle\Action\Type\ModalActionType #} {% block action_modal_control %}
    {% set modalId = 'modalId-' ~ random() %} {% set attr = { class: 'btn btn-primary', type: 'button', 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ modalId, 'data-action': 'kreyu--data-table-bundle--bootstrap-modal#open', }|merge(attr) %}
    {% endblock %} {# @see Kreyu\Bundle\DataTableBundle\Action\Type\Dropdown\DropdownActionType #} {% block action_dropdown_control %} {% set class = 'btn btn-primary d-inline-flex align-items-center gap-2' %} {% if with_caret %} {% set class = class ~ ' dropdown-toggle' %} {% endif %} {% set attr = { 'type': 'button', 'id': data_table.vars.name ~ '--' ~ context.value ~ '-action--' ~ name ~ '--button', 'aria-expanded': 'false', 'data-bs-toggle': 'dropdown', }|merge(attr|merge({ class: (class ~ ' ' ~ attr.class|default(''))|trim })) %} {# We must define the confirmation modals outside the ul/li, because the ul is in "position: relative" and that does not work properly with modals. #} {% for action in actions %} {% if action.vars.confirmation %} {% set href = action.vars.href %} {% set confirm_button_attr = { href }|merge(confirm_button_attr|default({})) %} {% set confirmation = action.vars.confirmation %} {% if batch %} {% set confirm_button_attr = { 'data-kreyu--data-table-bundle--batch-target': 'identifierHolder', }|merge(confirm_button_attr) %} {% endif %} {% with { confirm_button_attr, confirmation } only %}{{ block('action_confirmation_modal') }}{% endwith %} {% endif %} {% endfor %} {% endblock %} {% block action_link_dropdown_item_control %} {% set attr = attr|merge({ class: ('dropdown-item d-inline-flex align-items-center gap-2 ' ~ attr.class|default(''))|trim }) %} {% if confirmation %} {% set attr = { 'data-bs-toggle': 'modal', 'data-bs-target': '#' ~ confirmation.identifier, }|merge(attr) %} {% endif %} {{ parent() }} {% endblock %} {% block sort_arrow_none %} {% endblock %} {% block sort_arrow_asc %} {% endblock %} {% block sort_arrow_desc %} {% endblock %} {% block kreyu_data_table_date_range_widget %}
    {{ form_widget(form.from) }} - {{ form_widget(form.to) }}
    {% endblock %} {% block column_number_value %}
    {{ parent() }}
    {% endblock %} {% block column_money_value %}
    {{ parent() }}
    {% endblock %} {% block column_checkbox_header %} {% set attr = { class: 'text-center' }|merge(attr) %} {% with { attr, input_attr: { class: 'form-check-input mt-0' } } %} {{ parent() }} {% endwith %} {% endblock %} {% block column_checkbox_value %} {% set wrapper_attr = { class: 'w-100 h-100 text-center' }|merge(wrapper_attr|default({})) %}
    {% with { input_attr: { class: 'form-check-input' } } %} {{ parent() }} {% endwith %}
    {% endblock %} {% block column_icon_value -%} {% with { icon_attr: { height: '1em' }|merge(icon_attr) } -%} {{ parent() }} {%- endwith %} {%- endblock %}