You are here

tablesort-indicator.html.twig in Drupal 10

Theme override for displaying a tablesort indicator.

Available variables:

  • style: Either 'asc' or 'desc', indicating the sorting direction.

@todo Remove after https://www.drupal.org/node/1973418 is in.

File

core/themes/claro/templates/admin/tablesort-indicator.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for displaying a tablesort indicator.
  5. *
  6. * Available variables:
  7. * - style: Either 'asc' or 'desc', indicating the sorting direction.
  8. *
  9. * @todo Remove after https://www.drupal.org/node/1973418 is in.
  10. */
  11. #}
  12. {%
  13. set classes = [
  14. 'tablesort',
  15. 'tablesort--' ~ style,
  16. ]
  17. %}
  18. <span{{ attributes.addClass(classes) }}>
  19. {% if style in ['asc', 'desc'] %}
  20. <span class="visually-hidden">
  21. {% if style == 'asc' -%}
  22. {{ 'Sort ascending'|t }}
  23. {% else -%}
  24. {{ 'Sort descending'|t }}
  25. {% endif %}
  26. </span>
  27. {% endif %}
  28. </span>