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
|
= @champ.libelle
|
||||||
- if @champ.mandatory? && @champ.type_champ != "checkbox"
|
- if @champ.public? && !@champ.checkbox?
|
||||||
= render EditableChamp::AsteriskMandatoryComponent.new
|
- if @champ.mandatory?
|
||||||
- elsif !@champ.mandatory?
|
= render EditableChamp::AsteriskMandatoryComponent.new
|
||||||
= "#{t('.optional_champ')}"
|
- else
|
||||||
|
= "#{t('.optional_champ')}"
|
||||||
|
|
||||||
- if @champ.forked_with_changes?
|
- if @champ.forked_with_changes?
|
||||||
%span.updated-at.highlighted
|
%span.updated-at.highlighted
|
||||||
|
|
|
@ -59,6 +59,7 @@ class Champ < ApplicationRecord
|
||||||
:region?,
|
:region?,
|
||||||
:titre_identite?,
|
:titre_identite?,
|
||||||
:header_section?,
|
:header_section?,
|
||||||
|
:checkbox?,
|
||||||
:simple_drop_down_list?,
|
:simple_drop_down_list?,
|
||||||
:linked_drop_down_list?,
|
:linked_drop_down_list?,
|
||||||
:non_fillable?,
|
:non_fillable?,
|
||||||
|
|
|
@ -396,6 +396,10 @@ class TypeDeChamp < ApplicationRecord
|
||||||
type_champ == TypeDeChamp.type_champs.fetch(:datetime)
|
type_champ == TypeDeChamp.type_champs.fetch(:datetime)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def checkbox?
|
||||||
|
type_champ == TypeDeChamp.type_champs.fetch(:checkbox)
|
||||||
|
end
|
||||||
|
|
||||||
def public?
|
def public?
|
||||||
!private?
|
!private?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue