fix(dossier): only show optional text on public champs
This commit is contained in:
parent
f675d2d1a7
commit
a432323843
3 changed files with 10 additions and 4 deletions
|
@ -1,8 +1,9 @@
|
|||
= @champ.libelle
|
||||
- if @champ.mandatory? && @champ.type_champ != "checkbox"
|
||||
= render EditableChamp::AsteriskMandatoryComponent.new
|
||||
- elsif !@champ.mandatory?
|
||||
= "#{t('.optional_champ')}"
|
||||
- if @champ.public? && !@champ.checkbox?
|
||||
- if @champ.mandatory?
|
||||
= render EditableChamp::AsteriskMandatoryComponent.new
|
||||
- else
|
||||
= "#{t('.optional_champ')}"
|
||||
|
||||
- if @champ.forked_with_changes?
|
||||
%span.updated-at.highlighted
|
||||
|
|
|
@ -59,6 +59,7 @@ class Champ < ApplicationRecord
|
|||
:region?,
|
||||
:titre_identite?,
|
||||
:header_section?,
|
||||
:checkbox?,
|
||||
:simple_drop_down_list?,
|
||||
:linked_drop_down_list?,
|
||||
:non_fillable?,
|
||||
|
|
|
@ -396,6 +396,10 @@ class TypeDeChamp < ApplicationRecord
|
|||
type_champ == TypeDeChamp.type_champs.fetch(:datetime)
|
||||
end
|
||||
|
||||
def checkbox?
|
||||
type_champ == TypeDeChamp.type_champs.fetch(:checkbox)
|
||||
end
|
||||
|
||||
def public?
|
||||
!private?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue