Add default dossier_id to contact form on dossier pages

This commit is contained in:
Paul Chavard 2018-08-30 12:10:56 +01:00
parent a943856141
commit 7ac4dc355f
3 changed files with 10 additions and 3 deletions

View file

@ -56,7 +56,11 @@ module ApplicationHelper
def contact_link(title, options = {})
if Flipflop.support_form?
params = { tags: options[:tags], type: options[:type] }.compact
params = {
tags: options[:tags],
type: options[:type],
dossier_id: options[:dossier_id]
}.compact
link_to title, contact_url(params), options
else
mail_to CONTACT_EMAIL, title,

View file

@ -9,4 +9,7 @@
\-
= link_to 'CGU / Mentions légales', CGU_URL
\-
= contact_link 'Contact'
- if @facade.present? && @facade.respond_to?(:dossier)
= contact_link 'Contact', dossier_id: @facade.dossier&.id
- else
= contact_link 'Contact'

View file

@ -36,4 +36,4 @@
= link_to "Mentions légales", MENTIONS_LEGALES_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer"
= contact_link "Contact technique", class: "footer-link"
= contact_link "Contact technique", class: "footer-link", dossier_id: dossier.id