From 73ee4d69ca81ca256031069f84ced75f88a8d1df Mon Sep 17 00:00:00 2001 From: Judith Date: Tue, 23 Jun 2020 14:55:17 +0200 Subject: [PATCH 1/2] =?UTF-8?q?usager/dossiers:=20the=20link=20to=20the=20?= =?UTF-8?q?dossier=20is=20present:=20-=20in=20the=20'N=C2=B0=20de=20dossie?= =?UTF-8?q?r'=20column=20for=20mouse=20users=20and=20screen=20reader=20use?= =?UTF-8?q?rs.=20-=20in=20the=20'D=C3=A9marche'=20column=20for=20mouse=20u?= =?UTF-8?q?sers,=20screen=20reader=20users=20and=20keyboard=20users.=20Als?= =?UTF-8?q?o=20added=20a=20sr-only=20class=20for=20text=20which=20should?= =?UTF-8?q?=20be=20read=20by=20screen-readers=20but=20not=20visible=20or?= =?UTF-8?q?=20accessible=20to=20other=20users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../new_design/dossiers_table.scss | 14 +++++++++++++ app/views/users/dossiers/index.html.haml | 21 +++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/new_design/dossiers_table.scss b/app/assets/stylesheets/new_design/dossiers_table.scss index 1af317cdb..d95a49241 100644 --- a/app/assets/stylesheets/new_design/dossiers_table.scss +++ b/app/assets/stylesheets/new_design/dossiers_table.scss @@ -67,6 +67,7 @@ .label { width: 110px; text-align: center; + margin: 0 4px; } } @@ -84,3 +85,16 @@ width: 200px; } } + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + opacity: 0; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: none; +} diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 0c73c103e..f2271b8d3 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -29,36 +29,31 @@ %table.table.dossiers-table.hoverable %thead %tr - %th.notification-col %th.number-col Nº dossier %th Démarche - if @dossiers.count > 1 %th Demandeur %th.status-col Statut %th.updated-at-col Mis à jour - %th + %th.sr-only Actions %tbody - @dossiers.each do |dossier| %tr{ data: { 'dossier-id': dossier.id } } - %td.folder-col - = link_to(url_for_dossier(dossier), class: 'cell-link') do - %span.icon.folder %td.number-col - = link_to(url_for_dossier(dossier), class: 'cell-link') do + = link_to(url_for_dossier(dossier), class: 'cell-link', tabindex: -1) do + %span.icon.folder = dossier.id %td = link_to(url_for_dossier(dossier), class: 'cell-link') do = procedure_libelle(dossier.procedure) - if @dossiers.count > 1 - %td.number-col + %td.cell-link = demandeur_dossier(dossier) %td.status-col - = link_to(url_for_dossier(dossier), class: 'cell-link') do - = status_badge(dossier.state) - %td.updated-at-col - = link_to(url_for_dossier(dossier), class: 'cell-link') do - = try_format_date(dossier.updated_at) - %td.action-col.action-col + = status_badge(dossier.state) + %td.updated-at-col.cell-link + = try_format_date(dossier.updated_at) + %td.action-col = render partial: 'dossier_actions', locals: { dossier: dossier } = paginate(@dossiers) From bbcd432eaa37a2c0955fe4a9ae945b4e7339cd78 Mon Sep 17 00:00:00 2001 From: Judith Date: Mon, 29 Jun 2020 11:02:57 +0200 Subject: [PATCH 2/2] class 'sr-only' transfered to accessibilite.scss --- .../stylesheets/new_design/accessibilite.scss | 14 ++++++++++++++ .../stylesheets/new_design/dossiers_table.scss | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/new_design/accessibilite.scss b/app/assets/stylesheets/new_design/accessibilite.scss index eb2953da6..d3917e970 100644 --- a/app/assets/stylesheets/new_design/accessibilite.scss +++ b/app/assets/stylesheets/new_design/accessibilite.scss @@ -16,3 +16,17 @@ $new-p-margin-bottom: 3 * $default-space; .new-p { margin-bottom: $new-p-margin-bottom; } + +// A class to make elements only accessible to screen-readers +.sr-only { + position: absolute; + width: 1px; + height: 1px; + opacity: 0; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: none; +} diff --git a/app/assets/stylesheets/new_design/dossiers_table.scss b/app/assets/stylesheets/new_design/dossiers_table.scss index d95a49241..64ec0dc9f 100644 --- a/app/assets/stylesheets/new_design/dossiers_table.scss +++ b/app/assets/stylesheets/new_design/dossiers_table.scss @@ -85,16 +85,3 @@ width: 200px; } } - -.sr-only { - position: absolute; - width: 1px; - height: 1px; - opacity: 0; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border: none; -}