From 38bee3639d70ecd7354646edb6df5fc3a74d4b83 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 27 Nov 2023 13:56:13 +0100 Subject: [PATCH] style: replace legacy icon person --- app/assets/stylesheets/icons.scss | 4 ---- app/helpers/application_helper.rb | 8 ++++++++ .../administrateurs/experts_procedures/index.html.haml | 2 +- .../groupe_instructeurs/_instructeurs.html.haml | 2 +- .../administrateurs/procedures/_procedures_list.html.haml | 3 +-- app/views/invites/_dropdown.html.haml | 2 +- app/views/root/patron.html.haml | 1 - app/views/users/dossiers/_dossier_actions.html.haml | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index 84fc3f272..4aeed0ea0 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -113,10 +113,6 @@ background-image: image-url("icons/account-circle.svg"); } - &.person { - background-image: image-url("icons/blue-person.svg"); - } - &.super-admin { background-image: image-url("icons/super-admin.svg"); } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bb313aa30..a1ab8104f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -143,4 +143,12 @@ module ApplicationHelper def download_details(attachment) "#{attachment.filename.extension.upcase} – #{number_to_human_size(attachment.byte_size)}" end + + def dsfr_icon(classes, *options) + sm = options.include?(:sm) + mr = options.include?(:mr) + + tag.span(class: class_names(classes, 'fr-icon--sm': sm, 'fr-mr-1v': mr), + "aria-hidden" => true) + end end diff --git a/app/views/administrateurs/experts_procedures/index.html.haml b/app/views/administrateurs/experts_procedures/index.html.haml index a68895352..886aa061f 100644 --- a/app/views/administrateurs/experts_procedures/index.html.haml +++ b/app/views/administrateurs/experts_procedures/index.html.haml @@ -81,7 +81,7 @@ - @experts_procedure.each do |expert_procedure| %tr %td - %span.icon.person + = dsfr_icon('fr-icon-user-fill') = expert_procedure.expert.email %td.text-center = expert_procedure.avis.count diff --git a/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml b/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml index 0b94f472a..ad0f5e0a5 100644 --- a/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml @@ -28,7 +28,7 @@ - instructeurs.each do |instructeur| %tr %td - %span.icon.person + = dsfr_icon('fr-icon-user-fill') #{instructeur.email} - confirmation_message = procedure.routing_enabled? ? "Êtes-vous sûr de vouloir retirer l’instructeur « #{instructeur.email} » du groupe « #{groupe_instructeur.label} » ?" : "Êtes-vous sûr de vouloir retirer l’instructeur « #{instructeur.email} » de la démarche ?" diff --git a/app/views/administrateurs/procedures/_procedures_list.html.haml b/app/views/administrateurs/procedures/_procedures_list.html.haml index 31a3f6cdc..dee3bc18e 100644 --- a/app/views/administrateurs/procedures/_procedures_list.html.haml +++ b/app/views/administrateurs/procedures/_procedures_list.html.haml @@ -43,11 +43,10 @@ = procedure.auto_archive_on.strftime('%d/%m/%Y') %div + = dsfr_icon('fr-icon-team-fill') - if procedure.routing_enabled? - %span.icon.person %span.fr-badge= procedure.groupe_instructeurs.count - else - %span.icon.person %span.fr-badge= procedure.instructeurs.count %span.icon.folder.fr-ml-1w diff --git a/app/views/invites/_dropdown.html.haml b/app/views/invites/_dropdown.html.haml index 63c7f812b..45a00864c 100644 --- a/app/views/invites/_dropdown.html.haml +++ b/app/views/invites/_dropdown.html.haml @@ -1,7 +1,7 @@ - invites = dossier.invites.load = render Dropdown::MenuComponent.new(wrapper: :span, wrapper_options: {class: 'invite-user-action'}, button_options: { class: ['fr-btn--secondary'] }, menu_options: { id: 'invite-content' }) do |menu| - menu.with_button_inner_html do - %span.icon.person + = dsfr_icon('fr-icon-user-add-fill', :sm, :mr) - if invites.present? = t('views.invites.dropdown.view_invited_people') %span.badge= invites.size diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index 1c221bdcc..60a559e37 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -20,7 +20,6 @@ %span.icon.justificatif %span.icon.printer %span.icon.account - %span.icon.person %span.icon.super-admin %span.icon.mail %span.icon.reply diff --git a/app/views/users/dossiers/_dossier_actions.html.haml b/app/views/users/dossiers/_dossier_actions.html.haml index 64b54de09..80a90a8a9 100644 --- a/app/views/users/dossiers/_dossier_actions.html.haml +++ b/app/views/users/dossiers/_dossier_actions.html.haml @@ -24,7 +24,7 @@ - if has_transfer_action - menu.with_item do = link_to(transferer_dossier_path(dossier), role: 'menuitem') do - %span.icon.person + = dsfr_icon('fr-icon-user-add-fill', :sm) .dropdown-description = t('views.users.dossiers.dossier_action.transfer_dossier')