change PieceJustificativeController :
replace edit by show add update
This commit is contained in:
parent
f92f0f46cc
commit
1379d6d495
10 changed files with 145 additions and 99 deletions
|
@ -1,25 +1,16 @@
|
|||
- types_de_piece_justificative.each do |type_de_piece_justificative|
|
||||
- type_de_piece_justificative.id.nil? ? object_for = "new_type_de_piece_justificative[#{index}]" : object_for = 'types_de_piece_justificative[]'
|
||||
|
||||
= f.fields_for object_for, type_de_piece_justificative do |ff|
|
||||
.form-inline{id:"type_de_piece_justificative_#{type_de_piece_justificative.id || index}", class: 'type_de_piece_justificative', style: 'padding-bottom:8px'}
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4 Libellé
|
||||
=ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
|
||||
= f.fields_for :types_de_piece_justificative, types_de_piece_justificative do |ff|
|
||||
.form-inline
|
||||
.form-group
|
||||
%h4 Libellé
|
||||
=ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
|
||||
|
||||
.form-group{ style: 'padding-right: 2%' }
|
||||
%h4
|
||||
Description
|
||||
=ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
||||
.form-group
|
||||
%h4 Description
|
||||
=ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
||||
|
||||
=ff.hidden_field '_destroy', value: 'false', class: 'destroy'
|
||||
|
||||
.form-group{ id: "delete_type_de_piece_justificative_#{type_de_piece_justificative.id || index}_button", style: ("display:none" if type_de_piece_justificative.id.nil?) }
|
||||
-if ff.object.id.nil?
|
||||
.form-group#add_type_de_piece_justificative_button
|
||||
%br
|
||||
%button.form-control.btn.btn-danger.fa.fa-trash-o{type: 'button', id: "delete_type_de_piece_justificative_#{type_de_piece_justificative.id || index}_procedure"}
|
||||
|
||||
-if type_de_piece_justificative.id.nil?
|
||||
.form-group#add_type_de_piece_justificative_button
|
||||
%br
|
||||
%button.form-control.btn.btn-success#add_type_de_piece_justificative_procedure{type: 'button'} Ajouter
|
||||
= f.submit('Ajouter la pièce')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue