diff --git a/app/views/shared/dossiers/_update_contact_information.html.haml b/app/views/shared/dossiers/_update_contact_information.html.haml new file mode 100644 index 00000000000..9daa3e8cd3b --- /dev/null +++ b/app/views/shared/dossiers/_update_contact_information.html.haml @@ -0,0 +1,30 @@ +#contact_information + - service = @dossier&.service || @procedure.service + - if service.present? + %h3.fr-footer__top-cat= I18n.t('users.procedure_footer.managed_by.header') + .fr-footer__top-link.fr-pb-2w + %span{ lang: :fr }= service.pretty_nom + %div{ lang: :fr } + = render SimpleFormatComponent.new(service.adresse, class_names_map: {paragraph: 'fr-footer__content-desc'}) + %h3.fr-footer__top-cat= I18n.t('users.procedure_footer.contact.header') + %ul.fr-footer__top-list + - if @dossier.present? && @dossier.messagerie_available? + %li + = link_to I18n.t('users.procedure_footer.contact.in_app_mail.link'), messagerie_dossier_path(@dossier), class: 'fr-footer__top-link' + - elsif service.present? + %li + %span.fr-footer__top-link + = I18n.t('users.procedure_footer.contact.email.link') + = link_to service.email, "mailto:#{service.email}", class: "fr-footer__top-link" + + - if service.present? + - if service.telephone.present? || service.horaires.present? + %li + - horaires = "#{I18n.t('users.procedure_footer.contact.schedule.prefix')}#{formatted_horaires(service.horaires)}" + - if service.telephone.present? + = link_to service.telephone_url, class: 'fr-footer__top-link' do + %p + = I18n.t('users.procedure_footer.contact.phone.link', service_telephone: service.telephone) + - if service.horaires.present? + %p + = horaires diff --git a/app/views/shared/dossiers/_update_service.turbo_stream.haml b/app/views/shared/dossiers/_update_service.turbo_stream.haml new file mode 100644 index 00000000000..104dcbeba7d --- /dev/null +++ b/app/views/shared/dossiers/_update_service.turbo_stream.haml @@ -0,0 +1 @@ += turbo_stream.replace "contact_information", partial: 'shared/dossiers/update_contact_information' diff --git a/app/views/users/_procedure_footer.html.haml b/app/views/users/_procedure_footer.html.haml index 409f0369b6d..61a9fc8dbb8 100644 --- a/app/views/users/_procedure_footer.html.haml +++ b/app/views/users/_procedure_footer.html.haml @@ -1,37 +1,9 @@ %footer.fr-footer.footer-procedure#footer{ role: "contentinfo" } - - service = dossier&.service || procedure.service .fr-footer__top.fr-mb-0 .fr-container .fr-grid-row.fr-grid-row--start.fr-grid-row--gutters .fr-col-12.fr-col-sm-4.fr-col-md-4 - - if service.present? - %h3.fr-footer__top-cat= I18n.t('users.procedure_footer.managed_by.header') - .fr-footer__top-link.fr-pb-2w - %span{ lang: :fr }= service.pretty_nom - %div{ lang: :fr } - = render SimpleFormatComponent.new(service.adresse, class_names_map: {paragraph: 'fr-footer__content-desc'}) - %h3.fr-footer__top-cat= I18n.t('users.procedure_footer.contact.header') - %ul.fr-footer__top-list - - if dossier.present? && dossier.messagerie_available? - %li - = link_to I18n.t('users.procedure_footer.contact.in_app_mail.link'), messagerie_dossier_path(dossier), class: 'fr-footer__top-link' - - elsif service.present? - %li - %span.fr-footer__top-link - = I18n.t('users.procedure_footer.contact.email.link') - = link_to service.email, "mailto:#{service.email}", class: "fr-footer__top-link" - - - if service.present? - - if service.telephone.present? || service.horaires.present? - %li - - horaires = "#{I18n.t('users.procedure_footer.contact.schedule.prefix')}#{formatted_horaires(service.horaires)}" - - if service.telephone.present? - = link_to service.telephone_url, class: 'fr-footer__top-link' do - %p - = I18n.t('users.procedure_footer.contact.phone.link', service_telephone: service.telephone) - - if service.horaires.present? - %p - = horaires + = render partial: 'shared/dossiers/update_contact_information' - politiques = politiques_conservation_de_donnees(procedure) - if politiques.present? diff --git a/app/views/users/dossiers/update.turbo_stream.haml b/app/views/users/dossiers/update.turbo_stream.haml index 91a898ab0e4..1c1121f5ae1 100644 --- a/app/views/users/dossiers/update.turbo_stream.haml +++ b/app/views/users/dossiers/update.turbo_stream.haml @@ -1 +1,2 @@ = render partial: 'shared/dossiers/update_champs', locals: { to_show: @to_show, to_hide: @to_hide, to_update: @to_update, dossier: @dossier } += turbo_stream.update "contact_information", partial: 'shared/dossiers/update_contact_information'