fix: can display contact_info nom on footer

This commit is contained in:
Christophe Robillard 2023-09-27 12:09:00 +02:00
parent 1060aadff7
commit 6035a16ecc
3 changed files with 9 additions and 1 deletions

View file

@ -9,6 +9,10 @@ class ContactInformation < ApplicationRecord
validates :adresse, presence: { message: 'doit être renseignée' }, allow_nil: false
validates :groupe_instructeur, presence: { message: 'doit être renseigné' }, allow_nil: false
def pretty_nom
nom
end
def telephone_url
if telephone.present?
"tel:#{telephone.gsub(/[[:blank:]]/, '')}"

View file

@ -25,6 +25,10 @@ class Service < ApplicationRecord
validates :adresse, presence: { message: 'doit être renseignée' }, allow_nil: false
validates :administrateur, presence: { message: 'doit être renseigné' }, allow_nil: false
def pretty_nom
"#{nom}, #{organisme}"
end
def clone_and_assign_to_administrateur(administrateur)
service_cloned = self.dup
service_cloned.administrateur = administrateur

View file

@ -7,7 +7,7 @@
- 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.nom}, #{service.organisme},"
%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')