demarches-normaliennes/app/views/support/index.html.haml

108 lines
2.9 KiB
Text
Raw Normal View History

2018-08-29 11:44:12 +02:00
- content_for(:title, 'Contact')
#contact-form
.container
%h1.new-h1 Contact
.description
Contactez-nous via ce formulaire et nous vous répondrons dans les plus brefs délais.
2019-02-12 18:52:55 +01:00
Pensez bien à nous donner le plus d'informations possible pour que nous puissions vous aider au mieux
2018-08-29 11:44:12 +02:00
= form_tag contact_path, method: :post, multipart: true, class: 'form' do |f|
- if !logged_in?
.contact-champ
= label_tag :email do
Email
%span.mandatory *
2018-08-30 13:47:13 +02:00
= text_field_tag :email, params[:email], required: true
2018-08-29 11:44:12 +02:00
.contact-champ
= label_tag :type do
Votre problème
%span.mandatory *
2019-02-12 18:52:55 +01:00
= select_tag :type, options_for_select(@options, params[:type]),include_blank:"Choisir un problème", onchange:"show()"
#info_demarche.contact-champ.aidesupport.hide
Mon texte info_demarche
%br
%br
#usager_perdu.contact-champ.aidesupport.hide
Mon texte usager_perdu
%br
%br
#info_instruction.contact-champ.aidesupport.hide
Mon texte info_instruction
%br
%br
2018-08-29 11:44:12 +02:00
.contact-champ
= label_tag :dossier_id, 'Numéro du dossier concerné'
= text_field_tag :dossier_id, @dossier_id
.contact-champ
= label_tag :subject do
Sujet
%span.mandatory *
2018-08-30 13:47:13 +02:00
= text_field_tag :subject, params[:subject], required: true
2018-08-29 11:44:12 +02:00
.contact-champ
= label_tag :text do
Message
%span.mandatory *
2018-08-30 13:47:13 +02:00
= text_area_tag :text, params[:text], rows: 6, required: true
2018-08-29 11:44:12 +02:00
.contact-champ
= label_tag :text, 'Pièce jointe'
= file_field_tag :file
= hidden_field_tag :tags, @tags&.join(',')
2018-08-29 11:44:12 +02:00
.send-wrapper
= button_tag 'Envoyer le message', type: :submit, class: 'button send primary'
2019-02-12 18:52:55 +01:00
:javascript
function show(){
var e = document.getElementById ("type");
var choix = e.options [e.selectedIndex] .value;
var divid = choix.replace(' ','_');
var div_info_demarche = document.getElementById("info_demarche");
var div_usager_perdu_ = document.getElementById("usager_perdu");
var div_info_instruction = document.getElementById("info_instruction");
console.log(divid);
switch (divid) {
case 'info_demarche':
console.log('info_demarche');
document.getElementById("info_demarche").classList.add("show");
break;
case 'usager_perdu':
console.log('usager_perdu');
document.getElementById("usager_perdu").classList.add("show");
break;
case 'info_instruction':
console.log('info_instruction');
document.getElementById("info_instruction").classList.add("show");
break;
default:
console.log('defaut');
}
}