From 5b7baa8b47d232b443235e17377b60c425ac3d78 Mon Sep 17 00:00:00 2001 From: rich Date: Tue, 17 Sep 2024 09:47:51 +0100 Subject: [PATCH] Add aria sort labelling to column In order to improve the dashboard for screen reader users we add aria labelling to the columns --- macros.njk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/macros.njk b/macros.njk index e63fa72..c421f7a 100644 --- a/macros.njk +++ b/macros.njk @@ -13,15 +13,23 @@ {%endset%} - {% set sortingOnThisParam = id === sortBy %} {% set linkParams = "?sortBy=" + id + "&sortDirection=asc" %} +{%set ariaSort = "none"%} {%if sortingOnThisParam and sortDirection === "asc"%} {% set linkParams = "?sortBy=" + id + "&sortDirection=desc" %} + {%set ariaSort = "ascending"%} +{%endif%} + +{%if sortingOnThisParam and sortDirection === "desc"%} + {% set linkParams = "?sortBy=" + id + "&sortDirection=asc" %} + {%set ariaSort = "descending"%} {%endif%} - {{name}} + + + {{name}} {% if sortDirection === "asc" and sortingOnThisParam %}