Skip to content

Commit 3f94f4b

Browse files
committed
Added a label to the index table's "actions" columns
The "actions" columns in the collection table did not have any text in the column header cells. This was fine visually because it's a common pattern to use the final cells for action buttons. But people using a screen readers may not have this visual context. By adding a title of "Actions" to the column, this title is now announced by screen readers when moving into that column.
1 parent f335cb5 commit 3f94f4b

29 files changed

Lines changed: 79 additions & 11 deletions
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
<% [existing_action?(collection_presenter.resource_name, :edit),
2-
existing_action?(collection_presenter.resource_name, :destroy)].count(true).times do %>
3-
<th scope="col" class="cell-label--action-button"></th>
1+
<% colspan = [
2+
existing_action?(collection_presenter.resource_name, :edit),
3+
existing_action?(collection_presenter.resource_name, :destroy),
4+
].count(true)
5+
%>
6+
7+
<% if colspan > 0 %>
8+
<th scope="col" class="cell-label--action-button" colspan="<%= colspan %>">Actions</th>
49
<% end %>

config/locales/administrate.ar.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ ar:
2828
search:
2929
clear: مسح البحث
3030
label: بحث %{resource}
31+
table:
32+
actions: العمليات

config/locales/administrate.bs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ bs:
2727
search:
2828
clear: Izbriši pretraživanje
2929
label: Pretraga %{resource}
30+
table:
31+
actions: Akcije

config/locales/administrate.ca.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ ca:
2828
search:
2929
clear: Esborrar la cerca
3030
label: Cerca %{resource}
31+
table:
32+
actions: Accions

config/locales/administrate.da.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ da:
2828
search:
2929
clear: Ryd søgning
3030
label: Søg %{resource}
31+
table:
32+
actions: Handlinger

config/locales/administrate.de.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ de:
2828
search:
2929
clear: Suche zurücksetzen
3030
label: "%{resource} durchsuchen"
31+
table:
32+
actions: Aktionen

config/locales/administrate.en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ en:
2828
search:
2929
clear: Clear search
3030
label: Search %{resource}
31+
table:
32+
actions: Actions

config/locales/administrate.es.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ es:
2828
search:
2929
clear: Borrar búsqueda
3030
label: Buscar %{resource}
31+
table:
32+
actions: Acciones

config/locales/administrate.fi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ fi:
2828
search:
2929
clear: Tyhjennä haku
3030
label: Etsi %{resource}
31+
table:
32+
actions: Toiminnot

config/locales/administrate.fr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ fr:
2828
search:
2929
clear: Effacer la recherche
3030
label: Chercher %{resource}
31+
table:
32+
actions: Actions

0 commit comments

Comments
 (0)