From d4eed1c63189d3321257f01036f6ae4e333e2943 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 14 Nov 2022 21:57:24 +0100 Subject: [PATCH] style(manager): message on invisible champ due to conditional --- app/assets/stylesheets/manager.scss | 6 +++++- .../champ_collection_field/_row.html.haml | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/manager.scss b/app/assets/stylesheets/manager.scss index d80dbbeb2..973137e02 100644 --- a/app/assets/stylesheets/manager.scss +++ b/app/assets/stylesheets/manager.scss @@ -41,9 +41,13 @@ } .pl-8 { - padding-left: ($default-spacer * 8) !important + padding-left: ($default-spacer * 8) !important; } .cell-group-header { font-weight: 600; } + +.cell-disabled { + opacity: 0.6; +} diff --git a/app/views/fields/champ_collection_field/_row.html.haml b/app/views/fields/champ_collection_field/_row.html.haml index 6fc6199f9..db090e3f2 100644 --- a/app/views/fields/champ_collection_field/_row.html.haml +++ b/app/views/fields/champ_collection_field/_row.html.haml @@ -1,18 +1,21 @@ %tr - %td.cell-data{ class: row.child? ? "pl-8" : nil } + %td.cell-data{ class: [row.child? ? "pl-8" : nil, row.visible? ? nil : "cell-disabled"] } = row.libelle - if row.mandatory? %span.mandatory{ style: 'color: #A10005;' } * - %td.cell-data + %td.cell-data{ class: [row.visible? ? nil : "cell-disabled"] } = I18n.t("activerecord.attributes.type_de_champ.type_champs.#{row.type_champ}") - %td.cell-data - - if row.blank? && row.mandatory? - ⭕ - - else - ✔️ + %td.cell-data{ class: [row.visible? ? nil : "cell-disabled"] } + - if row.visible? + - if row.blank? && row.mandatory? + 🔴 + - else + 🟢 - - if row.blank? + - if !row.visible? && row.conditional? + masqué, conditionnel + - elsif row.blank? vide - else rempli