diff --git a/app/models/communication/block/template/agenda.rb b/app/models/communication/block/template/agenda.rb index 9442948a9dd4374f72747ad0eb56409975140081..ddbd35eb2d39313b5544086c0f87d6e539ef78f6 100644 --- a/app/models/communication/block/template/agenda.rb +++ b/app/models/communication/block/template/agenda.rb @@ -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 diff --git a/app/models/communication/block/template/base.rb b/app/models/communication/block/template/base.rb index b241d11b2582396184500e9e6d555370d5577f0d..8bc0ed6b948a982a54bd2fa1d9b3573a518d894f 100644 --- a/app/models/communication/block/template/base.rb +++ b/app/models/communication/block/template/base.rb @@ -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 diff --git a/app/models/communication/block/template/license.rb b/app/models/communication/block/template/license.rb index a34d1f2fbdf055ca94c420649fd07ab2d11a6255..68928e9953c28dbc8e6d0adc983e560b98d8b3af 100644 --- a/app/models/communication/block/template/license.rb +++ b/app/models/communication/block/template/license.rb @@ -1,8 +1,10 @@ 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 diff --git a/app/models/communication/block/template/organization.rb b/app/models/communication/block/template/organization.rb index 536f24452d0f77ad58eba951038da90745e4b794..ac33cfa56ec72cfb31fa530fb23099b648ede5d1 100644 --- a/app/models/communication/block/template/organization.rb +++ b/app/models/communication/block/template/organization.rb @@ -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 diff --git a/app/models/communication/block/template/page.rb b/app/models/communication/block/template/page.rb index 8ae847626be968e0cfdf709c56986817978e61eb..16a94047e21a97236e786471b88ee056d9ea9277 100644 --- a/app/models/communication/block/template/page.rb +++ b/app/models/communication/block/template/page.rb @@ -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 diff --git a/app/models/communication/block/template/person.rb b/app/models/communication/block/template/person.rb index adada3cb3f1c339db469f985461cfeada2b08b90..9a01a2d608b7e3112e81302ca2a0e75b1e225ec7 100644 --- a/app/models/communication/block/template/person.rb +++ b/app/models/communication/block/template/person.rb @@ -14,4 +14,8 @@ class Communication::Block::Template::Person < Communication::Block::Template::B end @elements end + + def children + elements + end end diff --git a/app/models/communication/block/template/post.rb b/app/models/communication/block/template/post.rb index de2ad77e93ac2f575e7ce5fc41f42697dfc418dc..24c0ee8a6932f16f36e8303b59a371ae3c61789e 100644 --- a/app/models/communication/block/template/post.rb +++ b/app/models/communication/block/template/post.rb @@ -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 diff --git a/app/models/communication/block/template/program.rb b/app/models/communication/block/template/program.rb index a187c301e5fc46d0875f784935463424327cf1d3..d35d5f2c55414c8343a70bc163bbf310a9054366 100644 --- a/app/models/communication/block/template/program.rb +++ b/app/models/communication/block/template/program.rb @@ -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 diff --git a/app/models/communication/block/with_heading_ranks.rb b/app/models/communication/block/with_heading_ranks.rb index e134f0ae8cb7f88a684eeab756d565a3999c2d8a..33ea91848646e8586cc9844c8c6e1f48253409a4 100644 --- a/app/models/communication/block/with_heading_ranks.rb +++ b/app/models/communication/block/with_heading_ranks.rb @@ -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