-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(routing): replace contact information with turbo_stream
- Loading branch information
Showing
4 changed files
with
33 additions
and
29 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/views/shared/dossiers/_update_contact_information.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
= turbo_stream.replace "contact_information", partial: 'shared/dossiers/update_contact_information' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |