Skip to content
Snippets Groups Projects
Unverified Commit 0d9c81c9 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Merge pull request #1406 from noesya/fix-block-ranks

Réparation des niveaux de blocs
parents 25860e7c 9c6ffa9c
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,10 @@ class Communication::Block::Template::Agenda < Communication::Block::Template::B
def allowed_for_about?
website.present?
end
def children
selected_events
end
protected
......
......@@ -141,6 +141,10 @@ class Communication::Block::Template::Base
@full_text
end
def children
false
end
def to_s
self.class.to_s.demodulize
end
......
class Communication::Block::Template::License < Communication::Block::Template::Base
has_component :description, :rich_text
has_component :type, :option, options: [:creative_commons]
has_component :creative_commons_attribution, :option, options: [:false, :true]
has_component :creative_commons_commercial_use, :option, options: [:true, :false]
has_component :creative_commons_derivatives, :option, options: [:true, :false]
has_component :creative_commons_sharing, :option, options: [:true, :false]
end
......@@ -18,4 +18,8 @@ class Communication::Block::Template::Organization < Communication::Block::Templ
def organizations
@organizations ||= elements.collect(&:organization).compact.uniq
end
def children
organizations
end
end
......@@ -24,6 +24,10 @@ class Communication::Block::Template::Page < Communication::Block::Template::Bas
def allowed_for_about?
!website.nil?
end
def children
selected_pages
end
protected
......
......@@ -14,4 +14,8 @@ class Communication::Block::Template::Person < Communication::Block::Template::B
end
@elements
end
def children
elements
end
end
......@@ -21,6 +21,10 @@ class Communication::Block::Template::Post < Communication::Block::Template::Bas
def allowed_for_about?
!website.nil?
end
def children
selected_posts
end
protected
......
......@@ -17,4 +17,8 @@ class Communication::Block::Template::Program < Communication::Block::Template::
def available_programs
website.education_programs
end
def children
selected_programs
end
end
......@@ -15,7 +15,7 @@ module Communication::Block::WithHeadingRanks
end
def heading_children?
template.respond_to?(:elements) && template.elements.any?
template.children && template.children.any?
end
protected
......
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