app/views/layouts/admin/cms/_left.html.haml in cms-fortress-1.1.1 vs app/views/layouts/admin/cms/_left.html.haml in cms-fortress-1.1.2
- old
+ new
@@ -1,33 +1,32 @@
= render '/admin/cms/partials/navigation_before'
%ul.navigation
- if admin_page?
- - if can? :view, 'settings.sites'
- = leftnav_item t('admin.cms.base.sites'), admin_cms_sites_path, :active => ['admin/cms/sites']
- - if can? :view, 'settings.roles'
- = leftnav_item t('cms.fortress.roles.title'), cms_fortress_roles_path
- - if can? :view, 'settings.users'
- = leftnav_item t('cms.fortress.users.title'), cms_fortress_users_path
+ - Cms::Fortress.configuration.settings_resources.each do |resource|
+ - if can? :view, "settings.#{resource[:name]}"
+ - path = begin; eval(resource[:path]); rescue; end
+ - if path
+ = leftnav_item t(resource[:title]), path
= render 'cms/fortress/admin/left_settings_nav'
- elsif design_page?
- - if @site && !@site.new_record?
- - if can? :view, 'designs.layouts'
- = leftnav_item t('admin.cms.base.layouts'), admin_cms_site_layouts_path(@site)
- - if can? :view, 'designs.snippets'
- = leftnav_item t('admin.cms.base.snippets'), admin_cms_site_snippets_path(@site)
+ - Cms::Fortress.configuration.design_resources.each do |resource|
+ - if can? :view, "designs.#{resource[:name]}"
+ - path = begin; eval(resource[:path]);rescue;end
+ - if path
+ = leftnav_item t(resource[:title]), path
= render 'cms/fortress/admin/left_designs_nav'
- elsif content_page?
- - if @site && !@site.new_record?
- - if can? :view, 'contents.pages'
- = leftnav_item t('admin.cms.base.pages'), admin_cms_site_pages_path(@site)
- - if can? :view, 'contents.files'
- = leftnav_item t('admin.cms.base.files'), admin_cms_site_files_path(@site)
+ - Cms::Fortress.configuration.content_resources.each do |resource|
+ - if can? :view, "contents.#{resource[:name]}"
+ - path = begin; eval(resource[:path]);rescue;end
+ - if path
+ = leftnav_item t(resource[:title]), path
= render 'cms/fortress/admin/left_contents_nav'
= cms_hook :navigation