amelioration(users/dossiers#demande): passage a la nouvelle ui/ux
wip
This commit is contained in:
parent
dc0eaed2f0
commit
43c6f03d10
31 changed files with 487 additions and 349 deletions
|
@ -1,21 +1,28 @@
|
|||
class EditableChamp::HeaderSectionComponent < ApplicationComponent
|
||||
def initialize(form: nil, champ:, seen_at: nil)
|
||||
def initialize(form: nil, champ:, seen_at: nil, html_class: {})
|
||||
@champ = champ
|
||||
@html_class = html_class
|
||||
end
|
||||
|
||||
def level
|
||||
@champ.level + 1 # skip one heading level
|
||||
end
|
||||
|
||||
def collapsible?
|
||||
@champ.level == 1
|
||||
end
|
||||
|
||||
def libelle
|
||||
@champ.libelle
|
||||
end
|
||||
|
||||
def header_section_classnames
|
||||
class_names(
|
||||
"fr-h#{level}": true,
|
||||
'header-section': @champ.dossier.auto_numbering_section_headers_for?(@champ),
|
||||
'hidden': !@champ.visible?
|
||||
{
|
||||
"section-#{level}": true,
|
||||
'header-section': @champ.dossier.auto_numbering_section_headers_for?(@champ),
|
||||
'hidden': !@champ.visible?
|
||||
}.merge(@html_class)
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue