ui2022/table__header__label.html.twig line 1

Open in your IDE?
  1. {% set spacing = _args.spacing|default(false) %}
  2. {% set sort = _args.sort|default(null) %}
  3. {% set headerTitle = _args.headerTitle|default(null) %}
  4. {% set title = _args.title %}
  5. {% set style = '' %}
  6. {% if spacing is same as(true) %}
  7.     {% set style = 'cell--auto' %}
  8. {% elseif spacing matches '/^\\d+$/' %}
  9.     {% set style = 'w-%s'|format(
  10.         spacing
  11.     ) %}
  12. {% endif %}
  13. <th class="table__sort {{ style }}
  14.     {% if sort.active|default(false) %}
  15.         table__sort--active
  16.     {% endif %}
  17. ">
  18.     <a
  19.         href="#"
  20.         {% if sort %}
  21.         title="Sort by {{ title }}"
  22.         data-sn-sort="{{ sort.key }}"
  23.         data-sn-sort-dir="{{ sort.dir }}"
  24.         {% endif %}
  25.     >
  26.         {% if headerTitle is not null %}
  27.             <small>{{ headerTitle }}</small>
  28.             <br />
  29.         {% endif %}
  30.         <span>{{ title }}</span>
  31.         {% if sort %}
  32.             <i class="icon-chevron-{{ sort.dir|dir_flip|lower }}"></i>
  33.         {% endif %}
  34.     </a>
  35. </th>