at_theme-1.4.1/at_core/templates/dataset/table--forum-topic-list.html.twig
at_core/templates/dataset/table--forum-topic-list.html.twig
{# /** * @file * Theme override to display a table. * * Available variables: * - attributes: HTML attributes to apply to the <table> tag. * - caption: A localized string for the <caption> tag. * - colgroups: Column groups. Each group contains the following properties: * - attributes: HTML attributes to apply to the <col> tag. * Note: Drupal currently supports only one table header row, see * https://www.drupal.org/node/893530 and * http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_table/7#comment-5109. * - header: Table header cells. Each cell contains the following properties: * - tag: The HTML tag name to use; either 'th' or 'td'. * - attributes: HTML attributes to apply to the tag. * - content: A localized string for the title of the column. * - field: Field name (required for column sorting). * - sort: Default sort order for this column ("asc" or "desc"). * - sticky: A flag indicating whether to use a "sticky" table header. * - rows: Table rows. Each row contains the following properties: * - attributes: HTML attributes to apply to the <tr> tag. * - data: Table cells. * - no_striping: A flag indicating that the row should receive no * 'even / odd' styling. Defaults to FALSE. * - cells: Table cells of the row. Each cell contains the following keys: * - tag: The HTML tag name to use; either 'th' or 'td'. * - attributes: Any HTML attributes, such as "colspan", to apply to the * table cell. * - content: The string to display in the table cell. * - active_table_sort: A boolean indicating whether the cell is the active table sort. * - footer: Table footer rows, in the same format as the rows variable. * - empty: The message to display in an extra row if table does not have * any rows. * - no_striping: A boolean indicating that the row should receive no striping. * - header_columns: The number of columns in the header. * * @see template_preprocess_table() */ #} {# The svg must come before the <use> elements due to a bug in Safari. #} <svg style="display:none;"> {# Comment icon #} <symbol id="forum-icon-default" viewBox="0 0 24 20" preserveAspectRatio="xMinYMid"> <path d="M22.4 4.1c-1.1-1.3-2.5-2.3-4.4-3S14.2 0 12 0 7.8 0.4 6 1.1s-3.3 1.8-4.4 3C0.5 5.4 0 6.8 0 8.3c0 1.3 0.4 2.5 1.2 3.7s1.9 2.1 3.3 2.9c-0.1 0.3-0.2 0.7-0.3 1 -0.1 0.3-0.3 0.6-0.4 0.8 -0.1 0.2-0.3 0.4-0.4 0.7 -0.2 0.2-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c-0.9 0-1.6 0.4-2.3 1.2 -0.7 0.8-1 1.7-1 2.7 0 0.2 0.1 0.4 0.2 0.5 0.2 0.2 0.4 0.2 0.6 0.2h5.2l1 5.8c0 0.2 0.2 0.3 0.4 0.3h0c0.1 0 0.2 0 0.3-0.1 0.1-0.1 0.1-0.2 0.1-0.2l0.7-5.8h5.6c0.2 0 0.4-0.1 0.6-0.2 0.2-0.2 0.2-0.3 0.2-0.5C15 12.1 14.6 11.2 14 10.4zM6.3 8.8c0 0.1 0 0.2-0.1 0.3C6.1 9.2 6 9.2 5.8 9.2s-0.2 0-0.3-0.1C5.5 9.1 5.4 9 5.4 8.8V3.5c0-0.1 0-0.2 0.1-0.3s0.2-0.1 0.3-0.1 0.2 0 0.3 0.1c0.1 0.1 0.1 0.2 0.1 0.3V8.8z"/> </symbol> {# Lock icon #} <symbol id="forum-icon-closed" viewBox="0 0 16 20" preserveAspectRatio="xMinYMid"> <path d="M15.6 9.5c-0.3-0.3-0.6-0.4-0.9-0.4h-0.4V6.4c0-1.7-0.6-3.2-1.8-4.5C11.2 0.6 9.7 0 8 0S4.8 0.6 3.6 1.9C2.4 3.1 1.8 4.6 1.8 6.4v2.7H1.3C1 9.1 0.6 9.2 0.4 9.5 0.1 9.8 0 10.1 0 10.5v8.2c0 0.4 0.1 0.7 0.4 1C0.6 19.9 1 20 1.3 20h13.3c0.4 0 0.7-0.1 0.9-0.4 0.3-0.3 0.4-0.6 0.4-1v-8.2C16 10.1 15.9 9.8 15.6 9.5zM11.6 9.1H4.4V6.4c0-1 0.3-1.9 1-2.6C6.2 3.1 7 2.7 8 2.7s1.8 0.4 2.5 1.1c0.7 0.7 1 1.6 1 2.6V9.1z"/> </symbol> </svg> {% set column_count = 'cols-' ~ header|length %} <table{{ attributes.addClass('table', 'table--forum', 'forum', column_count) }}> {% if header %} <thead class="table__header forum-header"> <tr class="table__row forum-header__row"> {% for cell in header %} {% set cell_classes = [ 'table__cell', cell.active_table_sort ? 'is-active', cell.content.generatedLink ? 'is-sortable', ] %} <{{ cell.tag }}{{ cell.attributes.addClass(cell_classes) }}> {{- cell.content -}} </{{ cell.tag }}> {% endfor %} </tr> </thead> {% endif %} {% if rows %} <tbody class="table__body forum-list"> {% for row in rows %} {% set row_classes = [ 'table__row', not no_striping ? cycle(['odd', 'even'], loop.index0), ] %} <tr{{ row.attributes.addClass(row_classes) }}> {% for cell in row.cells %} <{{ cell.tag }}{{ cell.attributes.addClass('table__cell') }}> {{- cell.content -}} </{{ cell.tag }}> {% endfor %} </tr> {% endfor %} </tbody> {% elseif empty %} <tbody class="table__body forum-list forum-list--empty"> <tr class="table__row odd"> <td colspan="{{ header_columns }}" class="table__cell empty message">{{ empty }}</td> </tr> </tbody> {% endif %} </table>