From afff001e853e13b6478768974f577577f4d1aa51 Mon Sep 17 00:00:00 2001 From: Restioson Date: Thu, 3 Oct 2024 11:07:26 +0200 Subject: [PATCH] fix(a11y): clarity when start/end dates are missing Before this change, if the start or end dates were missing for a project, the screenreader would simply read "End Date:" or "Start Date:" and trail off. Now, it will read "End Date: Ongoing" and "Start Date: unspecified". For sighted users, the text is slightly greyed-out to indicate that the end date is not _really_ there (as the project is ongoing). --- app/templates/app/project_detail.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/templates/app/project_detail.html b/app/templates/app/project_detail.html index e7656623..5c88e3d4 100644 --- a/app/templates/app/project_detail.html +++ b/app/templates/app/project_detail.html @@ -35,12 +35,24 @@

{{ project.name }}

{% icon "date" %} - {% trans "Start Date:" %} {{ project.start_date|date:"Y-m-d" }} + {% trans "Start Date:" %} + + {% if project.start_date %} + {{ project.start_date|date:"Y-m-d" }} + {% else %} + {% trans "unspecified" %} + {% endif %}

{% icon "date" %} - {% trans "End Date:" %} {{ project.end_date|date:"Y-m-d" }} + {% trans "End Date:" %} + + {% if project.end_date %} + {{ project.end_date|date:"Y-m-d"|default:"" }} + {% else %} + {% trans "ongoing" %} + {% endif %}