chore(instructeurs): sections summary only on xl screens
This commit is contained in:
parent
0d744a0eb7
commit
d36d7b0d48
4 changed files with 21 additions and 18 deletions
|
@ -1,16 +1,18 @@
|
|||
class ViewableChamp::HeaderSectionsSummaryComponent < ApplicationComponent
|
||||
attr_reader :header_sections
|
||||
|
||||
def initialize(dossier:, is_private:)
|
||||
@dossier = dossier
|
||||
@is_private = is_private
|
||||
end
|
||||
|
||||
def header_sections
|
||||
@dossier.revision
|
||||
@header_sections = @dossier.revision
|
||||
.types_de_champ_for(scope: @is_private ? :private : :public)
|
||||
.filter(&:header_section?)
|
||||
.map { @dossier.project_champ(_1, nil) } # row_id not needed, do not link to repetiion header_sections
|
||||
end
|
||||
|
||||
def render? = header_sections.any?
|
||||
|
||||
def href(header_section) # used by viewable champs to anchor elements
|
||||
"##{header_section.input_group_id}"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue