Extract type de champ line

This commit is contained in:
simon lehericey 2020-02-07 15:33:47 +01:00 committed by GitHub Action
parent fe1833e1cd
commit a62e9fe6d2
2 changed files with 25 additions and 23 deletions

View file

@ -7,28 +7,8 @@
%td.cell-label Rempli
%td.cell-label Modifier le modèle
%tbody
- field.data.order(:order_place).each do |f|
%tr
%td.cell-data
= f.libelle
- if f.mandatory?
%span.mandatory{ style: 'color: #A10005;' } *
%td.cell-data
= I18n.t("activerecord.attributes.type_de_champ.type_champs.#{f.type_champ}")
%td.cell-data
- if f.blank?
vide
- else
rempli
%td.cell-data
- if f.type_champ == 'piece_justificative'
= form_for f,
url: change_piece_justificative_template_manager_procedure_path,
method: :post do |form|
= form.hidden_field :id
= form.file_field :piece_justificative_template
= form.submit 'modifier'
- field.data.order(:order_place).each do |type_de_champ|
= render partial: 'fields/types_de_champ_collection_field/type_champ_line',
locals: { type_de_champ: type_de_champ }
- else
Aucun

View file

@ -0,0 +1,22 @@
%tr
%td.cell-data
= type_de_champ.libelle
- if type_de_champ.mandatory?
%span.mandatory{ style: 'color: #A10005;' } *
%td.cell-data
= I18n.t("activerecord.attributes.type_de_champ.type_champs.#{type_de_champ.type_champ}")
%td.cell-data
- if type_de_champ.blank?
vide
- else
rempli
%td.cell-data
- if type_de_champ.type_champ == 'piece_justificative'
= form_for type_de_champ,
url: change_piece_justificative_template_manager_procedure_path,
method: :post do |form|
= form.hidden_field :id
= form.file_field :piece_justificative_template
= form.submit 'modifier'