Skip to content
Snippets Groups Projects
Unverified Commit 2370053c authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

Merge branch 'main' of github.com:noesya/osuny

parents 50312f7e 8cf7048b
No related branches found
No related tags found
No related merge requests found
......@@ -6,17 +6,17 @@ module WithBlocks
has_many :headings, as: :about, class_name: 'Communication::Block::Heading', dependent: :destroy
end
def content
unless @content
@content = []
def contents
unless @contents
@contents = []
blocks.without_heading.published.ordered.each do |block|
@content << block
@contents << block
end
headings.ordered.each do |heading|
@content << heading
@contents << heading
end
end
@content
@contents
end
# Basic rule is: TOC if 2 titles or more
......
json.contents about.content do |block_or_heading|
json.contents about.contents do |block_or_heading|
if block_or_heading.is_a? Communication::Block
json.partial! 'admin/communication/blocks/static', block: block_or_heading
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment