Extract some code in a helper
It makes the code clearer and will avoid some linting issues
This commit is contained in:
parent
a87e79ac1f
commit
66fcdda59b
2 changed files with 23 additions and 10 deletions
21
app/helpers/demande_helper.rb
Normal file
21
app/helpers/demande_helper.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
module DemandeHelper
|
||||
def nb_of_procedures_options
|
||||
{
|
||||
'je ne sais pas' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_DO_NOT_KNOW_VALUE,
|
||||
'1' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_1_VALUE,
|
||||
'1 à 10' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_1_TO_10_VALUE,
|
||||
'10 à 100 ' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_10_TO_100_VALUE,
|
||||
'plus de 100' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_ABOVE_100_VALUE
|
||||
}
|
||||
end
|
||||
|
||||
def deadline_options
|
||||
{
|
||||
'le plus vite possible' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_ASAP_VALUE,
|
||||
'dans les 3 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_3_MONTHS_VALUE,
|
||||
'dans les 6 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_6_MONTHS_VALUE,
|
||||
'dans les 12 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_12_MONTHS_VALUE,
|
||||
'pas de date' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NO_DATE_VALUE
|
||||
}
|
||||
end
|
||||
end
|
|
@ -46,11 +46,7 @@
|
|||
Combien de démarches souhaitez-vous dématerialiser ?
|
||||
%span.mandatory *
|
||||
= select_tag :nb_of_procedures,
|
||||
options_for_select({ 'je ne sais pas' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_DO_NOT_KNOW_VALUE,
|
||||
'1' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_1_VALUE,
|
||||
'1 à 10' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_1_TO_10_VALUE,
|
||||
'10 à 100 ' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_10_TO_100_VALUE,
|
||||
'plus de 100' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_ABOVE_100_VALUE }),
|
||||
options_for_select(nb_of_procedures_options),
|
||||
prompt: 'choisir un intervalle',
|
||||
required: true
|
||||
|
||||
|
@ -58,11 +54,7 @@
|
|||
À quelle échance voudriez-vous dématerialiser ?
|
||||
%span.mandatory *
|
||||
= select_tag :deadline,
|
||||
options_for_select({ 'le plus vite possible' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_ASAP_VALUE,
|
||||
'dans les 3 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_3_MONTHS_VALUE,
|
||||
'dans les 6 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_6_MONTHS_VALUE,
|
||||
'dans les 12 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_12_MONTHS_VALUE,
|
||||
'pas de date' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NO_DATE_VALUE }),
|
||||
options_for_select(deadline_options),
|
||||
prompt: 'choisir une échéance',
|
||||
required: true
|
||||
|
||||
|
|
Loading…
Reference in a new issue