Rename TypeDeChamps to TypeDeChamp
This commit is contained in:
parent
519af34c82
commit
f3d8645426
34 changed files with 644 additions and 634 deletions
|
@ -17,7 +17,7 @@
|
|||
%h3.text-info
|
||||
Liste des champs à remplir pour un dossier
|
||||
|
||||
=render partial: 'admin/procedures/types_de_champs/liste', locals: {f: f}
|
||||
=render partial: 'admin/procedures/types_de_champ/liste', locals: {f: f}
|
||||
|
||||
%br
|
||||
%br
|
||||
|
|
40
app/views/admin/procedures/types_de_champ/_form.html.haml
Normal file
40
app/views/admin/procedures/types_de_champ/_form.html.haml
Normal file
|
@ -0,0 +1,40 @@
|
|||
.form-inline{id:"type_de_champ_#{index}", style: 'padding-bottom:8px'}
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4 Libellé
|
||||
%input.form-control#libelle{ type: 'text', placeholder: 'Libelle', name:"type_de_champ[#{index}][libelle]", size: 40, value: ("#{ type_de_champ.libelle }" unless type_de_champ.nil? ) }
|
||||
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4 Type
|
||||
%select.form-control#type_champs{ name: "type_de_champ[#{index}][type]" }
|
||||
%option{ value: 'text', selected: (type_de_champ.type_champs == 'text' unless type_de_champ.nil?)}
|
||||
Simple texte
|
||||
%option{ value: 'textarea', selected: (type_de_champ.type_champs == 'textarea' unless type_de_champ.nil?)}
|
||||
Texte multi-lignes
|
||||
%option{ value: 'datetime', selected: (type_de_champ.type_champs == 'datetime' unless type_de_champ.nil?)}
|
||||
Date
|
||||
%option{ value: 'number', selected: (type_de_champ.type_champs == 'number' unless type_de_champ.nil?)}
|
||||
Valeur numérique
|
||||
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4
|
||||
Description
|
||||
%textarea.form-control#description{cols: 60, placeholder: 'Description', name: "type_de_champ[#{index}][description]"}
|
||||
=("#{ type_de_champ.description }" unless type_de_champ.nil? )
|
||||
|
||||
%input.order_place{type: 'hidden', name: "type_de_champ[#{index}][order_place]", value: (("#{ type_de_champ.order_place }" unless type_de_champ.nil?) || index+1)}
|
||||
%input#id_type_de_champ{type: 'hidden', name: "type_de_champ[#{index}][id_type_de_champ]", value: (("#{ type_de_champ.id}" unless type_de_champ.nil?))}
|
||||
%input#delete{type: 'hidden', name: "type_de_champ[#{index}][delete]", value: 'false'}
|
||||
|
||||
-if type_de_champ.nil?
|
||||
.form-group#add_type_de_champ_button
|
||||
%br
|
||||
%button.form-control.btn.btn-success#add_type_de_champ_procedure{type: 'button'} Ajouter
|
||||
|
||||
.form-group.order_type_de_champ_button{id: "order_type_de_champ_#{index}_button", style: ("display:none" if type_de_champ.nil?)}
|
||||
%br
|
||||
%button.form-control.btn.btn-default.button_up.fa.fa-chevron-up{type: 'button', id: "order_type_de_champ_#{index}_up_procedure"}
|
||||
%button.form-control.btn.btn-default.button_down.fa.fa-chevron-down{type: 'button', id: "order_type_de_champ_#{index}_down_procedure"}
|
||||
|
||||
.form-group{id: "delete_type_de_champ_#{index}_button", style: ("display:none" if type_de_champ.nil?)}
|
||||
%br
|
||||
%button.form-control.btn.btn-danger.fa.fa-trash-o{type: 'button', id: "delete_type_de_champ_#{index}_procedure"}
|
12
app/views/admin/procedures/types_de_champ/_liste.html.haml
Normal file
12
app/views/admin/procedures/types_de_champ/_liste.html.haml
Normal file
|
@ -0,0 +1,12 @@
|
|||
#liste_champ
|
||||
-if @procedure.types_de_champ.size > 0
|
||||
- @procedure.types_de_champ.order(:order_place).each_with_index do |type_de_champ, index|
|
||||
=render partial: 'admin/procedures/types_de_champ/form', locals:{ type_de_champ: type_de_champ, index: index }
|
||||
|
||||
#liste_delete_champ
|
||||
|
||||
#new_type_de_champ
|
||||
=render partial: 'admin/procedures/types_de_champ/form', locals:{ type_de_champ: nil, index: @procedure.types_de_champ.size }
|
||||
|
||||
%script{ type:'text/javascript' }
|
||||
="var types_de_champ_index = #{@procedure.types_de_champ.size}"
|
|
@ -1,40 +0,0 @@
|
|||
.form-inline{id:"type_de_champs_#{index}", style: 'padding-bottom:8px'}
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4 Libellé
|
||||
%input.form-control#libelle{ type: 'text', placeholder: 'Libelle', name:"type_de_champs[#{index}][libelle]", size: 40, value: ("#{ type_de_champs.libelle }" unless type_de_champs.nil? ) }
|
||||
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4 Type
|
||||
%select.form-control#type_champs{ name: "type_de_champs[#{index}][type]" }
|
||||
%option{ value: 'text', selected: (type_de_champs.type_champs == 'text' unless type_de_champs.nil?)}
|
||||
Simple texte
|
||||
%option{ value: 'textarea', selected: (type_de_champs.type_champs == 'textarea' unless type_de_champs.nil?)}
|
||||
Texte multi-lignes
|
||||
%option{ value: 'datetime', selected: (type_de_champs.type_champs == 'datetime' unless type_de_champs.nil?)}
|
||||
Date
|
||||
%option{ value: 'number', selected: (type_de_champs.type_champs == 'number' unless type_de_champs.nil?)}
|
||||
Valeur numérique
|
||||
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4
|
||||
Description
|
||||
%textarea.form-control#description{cols: 60, placeholder: 'Description', name: "type_de_champs[#{index}][description]"}
|
||||
=("#{ type_de_champs.description }" unless type_de_champs.nil? )
|
||||
|
||||
%input.order_place{type: 'hidden', name: "type_de_champs[#{index}][order_place]", value: (("#{ type_de_champs.order_place }" unless type_de_champs.nil?) || index+1)}
|
||||
%input#id_type_de_champs{type: 'hidden', name: "type_de_champs[#{index}][id_type_de_champs]", value: (("#{ type_de_champs.id}" unless type_de_champs.nil?))}
|
||||
%input#delete{type: 'hidden', name: "type_de_champs[#{index}][delete]", value: 'false'}
|
||||
|
||||
-if type_de_champs.nil?
|
||||
.form-group#add_type_de_champs_button
|
||||
%br
|
||||
%button.form-control.btn.btn-success#add_type_de_champs_procedure{type: 'button'} Ajouter
|
||||
|
||||
.form-group.order_type_de_champs_button{id: "order_type_de_champs_#{index}_button", style: ("display:none" if type_de_champs.nil?)}
|
||||
%br
|
||||
%button.form-control.btn.btn-default.button_up.fa.fa-chevron-up{type: 'button', id: "order_type_de_champs_#{index}_up_procedure"}
|
||||
%button.form-control.btn.btn-default.button_down.fa.fa-chevron-down{type: 'button', id: "order_type_de_champs_#{index}_down_procedure"}
|
||||
|
||||
.form-group{id: "delete_type_de_champs_#{index}_button", style: ("display:none" if type_de_champs.nil?)}
|
||||
%br
|
||||
%button.form-control.btn.btn-danger.fa.fa-trash-o{type: 'button', id: "delete_type_de_champs_#{index}_procedure"}
|
|
@ -1,12 +0,0 @@
|
|||
#liste_champs
|
||||
-if @procedure.types_de_champs.size > 0
|
||||
- @procedure.types_de_champs.order(:order_place).each_with_index do |type_de_champs, index|
|
||||
=render partial: 'admin/procedures/types_de_champs/form', locals:{ type_de_champs: type_de_champs, index: index }
|
||||
|
||||
#liste_delete_champs
|
||||
|
||||
#new_type_de_champs
|
||||
=render partial: 'admin/procedures/types_de_champs/form', locals:{ type_de_champs: nil, index: @procedure.types_de_champs.size }
|
||||
|
||||
%script{ type:'text/javascript' }
|
||||
="var types_de_champs_index = #{@procedure.types_de_champs.size}"
|
Loading…
Add table
Add a link
Reference in a new issue