feat(manager): shows ChampRepetition children
This commit is contained in:
parent
d961769a12
commit
d2ad8d8455
3 changed files with 33 additions and 15 deletions
|
@ -1,3 +1,5 @@
|
|||
@import "constants";
|
||||
|
||||
[data-reach-combobox-token-label] {
|
||||
border: 1px solid #CCCCCC;
|
||||
border-radius: 4px;
|
||||
|
@ -35,5 +37,13 @@
|
|||
}
|
||||
|
||||
.mt-1 {
|
||||
margin-top: 1rem;
|
||||
margin-top: $default-spacer !important;
|
||||
}
|
||||
|
||||
.pl-8 {
|
||||
padding-left: ($default-spacer * 8) !important
|
||||
}
|
||||
|
||||
.cell-group-header {
|
||||
font-weight: 600;
|
||||
}
|
21
app/views/fields/champ_collection_field/_row.html.haml
Normal file
21
app/views/fields/champ_collection_field/_row.html.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
%tr
|
||||
%td.cell-data{ class: row.child? ? "pl-8" : nil }
|
||||
= row.libelle
|
||||
- if row.mandatory?
|
||||
%span.mandatory{ style: 'color: #A10005;' } *
|
||||
%td.cell-data
|
||||
= I18n.t("activerecord.attributes.type_de_champ.type_champs.#{row.type_champ}")
|
||||
|
||||
%td.cell-data
|
||||
- if row.blank?
|
||||
vide
|
||||
- else
|
||||
rempli
|
||||
|
||||
- if row.respond_to?(:rows)
|
||||
- row.rows.each_with_index do |group_rows, index|
|
||||
%thead
|
||||
%tr
|
||||
%td.cell-group-header{ colspan: 3}
|
||||
= "Bloc ##{index + 1} “#{row.libelle}”"
|
||||
= render partial: "fields/champ_collection_field/row", collection: group_rows, as: :row
|
|
@ -6,19 +6,6 @@
|
|||
%td.cell-label Type de champ
|
||||
%td.cell-label Rempli
|
||||
%tbody
|
||||
- field.data.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
|
||||
= render partial: "fields/champ_collection_field/row", collection: field.data, as: :row
|
||||
- else
|
||||
Aucun
|
||||
|
|
Loading…
Reference in a new issue