Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% block empty_table_body_row %}
<tr class="ibexa-table__row">
<td class="ibexa-table__empty-table-cell" colspan="{{ colspan|default(9999) }}">
<img
Expand All @@ -20,3 +21,4 @@
</div>
</td>
</tr>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% block empty_table_extra_actions %}
<div class="ibexa-table__empty-table-extra-actions">
{% block extra_action_link %}
<a href="{{ url }}" class="ibexa-table__empty-table-extra-actions-link">
Expand All @@ -10,3 +11,4 @@
</a>
{% endblock %}
</div>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}

{% set show_head_cols_if_empty = show_head_cols_if_empty|default(false) %}

{% if is_last_column_sticky is not defined %}
{% if body_rows is defined %}
{% set no_action_cell_rows = body_rows|filter((row) => not (row.cols|last).has_action_btns|default(false)) %}
{% set is_last_column_sticky = no_action_cell_rows|length == 0 %}
{% else %}
{% set is_last_column_sticky = false %}
{% endif %}
{% endif %}
{% use '@ibexadesign/ui/component/table/table_body_row.html.twig' %}
{% use '@ibexadesign/ui/component/table/table_head_row.html.twig' %}
{% use '@ibexadesign/ui/component/table/table_header.html.twig' %}
{% use '@ibexadesign/ui/component/table/empty_table_body_row.html.twig' %}

{% block header %}
{% if headline is defined %}
{% include '@ibexadesign/ui/component/table/table_header.html.twig' with {
{% with {
headline,
actions: actions|default(null),
headline_title: headline_title|default(''),
notice_class: notice_class|default(''),
notice_message: notice_message|default(''),
notice_icon: notice_icon|default('about-info'),
show_notice: show_notice|default(false),
} only %}
} %}
{{ block('table_header') }}
{% endwith %}
{% endif %}
{% endblock %}

{% block between_header_and_table %}{% endblock %}

{% block table %}
{% set table_content %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
{% set show_head_cols_if_empty = show_head_cols_if_empty|default(false) %}
{% if is_last_column_sticky is not defined %}
{% if body_rows is defined %}
{% set no_action_cell_rows = body_rows|filter((row) => not (row.cols|last).has_action_btns|default(false)) %}
{% set is_last_column_sticky = no_action_cell_rows|length == 0 %}
{% else %}
{% set is_last_column_sticky = false %}
{% endif %}
{% endif %}

{% set empty_row %}
{% block tbody_empty %}
{% include '@ibexadesign/ui/component/table/empty_table_body_row.html.twig' with {
{% with {
colspan: head_cols|length,
empty_image: empty_image|default(asset('/bundles/ibexaadminui/img/ibexa-empty-table.svg'))
} %}
{{ block('empty_table_body_row') }}
{% endwith %}
{% endblock %}
{% endset %}

Expand All @@ -48,42 +55,42 @@
{{ empty_row }}
</template>
<thead {{ body_rows is defined and body_rows is not empty or head_cols is defined and show_head_cols_if_empty ? '' : 'hidden' }}>
{% block thead %}
{% if head_cols is defined %}
{% include '@ibexadesign/ui/component/table/table_head_row.html.twig' with {
head_cols,
} %}
{% endif %}
{% endblock %}
{% block thead %}
{% if head_cols is defined %}
{{ block('table_head_row') }}
{% endif %}
{% endblock %}
</thead>
<tbody
class="ibexa-table__body
{{ table_body_class|default('') -}}"
{{ html.attributes(table_body_attr|default({})) }}
>
{% block tbody %}
{% block tbody %}

{% if body_rows is defined %}
{% if body_rows is empty %}
{{ empty_row }}
{% else %}
{% block tbody_not_empty %}
{% for row in body_rows %}
{% include '@ibexadesign/ui/component/table/table_body_row.html.twig' with {
body_row_cols: row.cols,
class: row.class|default(''),
attr: row.attr|default({}),
} %}
{% endfor %}
{% endblock %}
{% endif %}
{% if body_rows is defined %}
{% if body_rows is empty %}
{{ empty_row }}
{% else %}
{% block tbody_not_empty %}
{% for row in body_rows %}
{% with {
body_row_cols: row.cols,
class: row.class|default(''),
attr: row.attr|default({}),
} %}
{{ block('table_body_row') }}
{% endwith %}
{% endfor %}
{% endblock %}
{% endif %}
{% endblock %}
{% endif %}
{% endblock %}
</tbody>
</table>
{% endset %}

{% if is_scrollable is defined ? is_scrollable : true %}
{% if is_scrollable|default(true) %}
<div class="ibexa-scrollable-wrapper">
{{ table_content }}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% block table_body_cell %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
{% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}

<td
class="ibexa-table__cell
Expand All @@ -12,9 +12,11 @@
{{ html.attributes(attr|default({})) }}
>
{%- block content -%}
{% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}
{%- if has_action_btns|default(false) -%}
<div class="ibexa-table__cell-btns-wrapper">
{%- block action_btns_content -%}
{% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}
{{- table_macros.conditional_escape(content, raw|default(false)) -}}
{%- endblock -%}
</div>
Expand All @@ -23,3 +25,4 @@
{%- endif -%}
{%- endblock -%}
</td>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{% use '@ibexadesign/ui/component/table/table_body_cell.html.twig' %}

{% block table_body_row %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}

<tr class="ibexa-table__row
Expand All @@ -7,7 +10,7 @@
{% block body_row_cells %}
{% set next_is_close_left = false %}
{% for body_col in body_row_cols %}
{% include '@ibexadesign/ui/component/table/table_body_cell.html.twig' with {
{% with {
has_checkbox: body_col.has_checkbox|default(false),
has_action_btns: body_col.has_action_btns|default(false),
has_icon: body_col.has_icon|default(false),
Expand All @@ -18,7 +21,10 @@
class: body_col.class|default(null),
attr: body_col.attr|default({}),
} %}
{{ block('table_body_cell') }}
{% endwith %}
{% set next_is_close_left = body_col.has_checkbox|default(false) or body_col.has_icon|default(false) %}
{% endfor %}
{% endblock %}
</tr>
</tr>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% block table_head_cell %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
{% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}

<th
class="ibexa-table__header-cell
Expand All @@ -11,6 +11,8 @@
{{ html.attributes(attr|default({})) }}
>
{%- block content -%}
{% import "@ibexadesign/ui/component/table/table_macros.html.twig" as table_macros %}
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}
{%- if has_checkbox|default(false) -%}
<div class="ibexa-table__header-cell-checkbox-wrapper">
<input
Expand All @@ -29,3 +31,4 @@
{%- endif -%}
{%- endblock -%}
</th>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{% use '@ibexadesign/ui/component/table/table_head_cell.html.twig' %}

{% block table_head_row %}
<tr class="ibexa-table__head-row">
{% block cells %}
{% for head_col in head_cols %}
{% include '@ibexadesign/ui/component/table/table_head_cell.html.twig' with {
{% with {
has_checkbox: head_col.has_checkbox|default(false),
is_custom_bulk: head_col.is_custom_bulk|default(false),
has_icon: head_col.has_icon|default(false),
Expand All @@ -13,7 +16,10 @@
attr: head_col.attr|default({}),
wrapper_attr: head_col.wrapper_attr|default({}),
} %}
{{ block('table_head_cell') }}
{% endwith %}
{% set next_is_close_left = head_col.has_checkbox|default(false) or head_col.has_icon|default(false) %}
{% endfor %}
{% endblock %}
</tr>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% block table_header %}
<div class="ibexa-table-header {{ class|default('') -}}">
<div
class="ibexa-table-header__headline"
Expand All @@ -23,4 +24,5 @@
{{ actions|default('')|raw }}
{% endblock %}
</div>
</div>
</div>
{% endblock %}
Loading