{# /** * @file * Default theme implementation for displaying a view as a table. * * Available variables: * - attributes: Remaining HTML attributes for the element. * - class: HTML classes that can be used to style contextually through CSS. * - title : The title of this group of rows. * - header: The table header columns. * - attributes: Remaining HTML attributes for the element. * - content: HTML classes to apply to each header cell, indexed by * the header's key. * - caption_needed: Is the caption tag needed. * - caption: The caption for this table. * - accessibility_description: Extended description for the table details. * - accessibility_summary: Summary for the table details. * - responsive: Whether or not to use the .table-responsive wrapper. * - rows: Table row items. Rows are keyed by row number. * - attributes: HTML classes to apply to each row. * - columns: Row column items. Columns are keyed by column number. * - attributes: HTML classes to apply to each column. * - content: The column content. * - bordered: Flag indicating whether or not the table should be bordered. * - condensed: Flag indicating whether or not the table should be condensed. * - hover: Flag indicating whether or not table rows should be hoverable. * - striped: Flag indicating whether or not table rows should be striped. * - responsive: Flag indicating whether or not the table should be wrapped to * be responsive (using the Bootstrap Framework .table-responsive wrapper). * * @ingroup templates * * @see template_preprocess_views_view_table() */ #} {% if responsive %}
{% endif %} {% set classes = [ 'table', bordered ? 'table-bordered', condensed ? 'table-condensed', hover ? 'table-hover', striped ? 'table-striped', sticky ? 'sticky-enabled', ] %} {% if caption_needed %} {% if caption %} {{ caption }} {% else %} {{ title }} {% endif %} {% if (summary is not empty) or (description is not empty) %}
{% if summary is not empty %} {{ summary }} {% endif %} {% if description is not empty %} {{ description }} {% endif %}
{% endif %} {% endif %} {% if header %} {% for key, column in header %} {% if column.default_classes %} {% set column_classes = [ 'views-field', 'views-field-' ~ fields[key], ] %} {% endif %} {%- if column.wrapper_element -%} <{{ column.wrapper_element }}> {%- if column.url -%} {{ column.content }}{{ column.sort_indicator }} {%- else -%} {{ column.content }}{{ column.sort_indicator }} {%- endif -%} {%- else -%} {%- if column.url -%} {{ column.content }}{{ column.sort_indicator }} {%- else -%} {{- column.content }}{{ column.sort_indicator }} {%- endif -%} {%- endif -%} {% endfor %} {% endif %} {% for row in rows %} {% for key, column in row.columns %} {% if column.default_classes %} {% set column_classes = [ 'views-field' ] %} {% for field in column.fields %} {% set column_classes = column_classes|merge(['views-field-' ~ field]) %} {% endfor %} {% endif %} {%- if column.wrapper_element -%} <{{ column.wrapper_element }}> {% for content in column.content %} {{ content.separator }}{{ content.field_output }} {% endfor %} {%- else -%} {% for content in column.content %} {{- content.separator }}{{ content.field_output -}} {% endfor %} {%- endif %} {% endfor %} {% endfor %} {% if responsive %}
{% endif %}