Module: DmCms::CmsPagesHelper
- Defined in:
- app/helpers/dm_cms/cms_pages_helper.rb
Instance Method Summary collapse
-
#nested_tree(tree) ⇒ Object
——————————————————————————.
-
#nested_tree_sidebar(tree) ⇒ Object
——————————————————————————.
-
#template_menu_list ⇒ Object
Return a list of templates defined in the theme.yml and it’s parent theme.
Instance Method Details
#nested_tree(tree) ⇒ Object
4 5 6 7 8 |
# File 'app/helpers/dm_cms/cms_pages_helper.rb', line 4 def nested_tree(tree) tree.map do |item, sub_items| render(:partial => 'tree', :locals => {:item => item, :sub_items => sub_items}) end.join.html_safe end |
#nested_tree_sidebar(tree) ⇒ Object
11 12 13 14 15 |
# File 'app/helpers/dm_cms/cms_pages_helper.rb', line 11 def (tree) tree.map do |item, sub_items| render(:partial => 'tree_sidebar', :locals => {:item => item, :sub_items => sub_items}) end.join.html_safe end |
#template_menu_list ⇒ Object
Return a list of templates defined in the theme.yml and it’s parent theme. The child templates should override any parent templates
20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/dm_cms/cms_pages_helper.rb', line 20 def theme = current_account.theme_data unless theme.empty? templates = (current_account.theme_data(parent: true)['templates'] || {}).merge(theme['templates'] || {}) [['Inherit from parent', '']] + templates.collect {|key, value| [value['name'], key] } else nil end end |