From ba4385e3fd682887c7d20d81f28f1fa3b0940996 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 8 May 2012 10:50:09 +0800 Subject: [PATCH] Add module authorization for news Add files and links to announcement and news Change page.children into page.ordered_and_visible_children in parser_commom --- app/views/layouts/_side_bar.html.erb | 1 + lib/parsers/parser_common.rb | 2 +- .../front_end/bulletins/show.html.erb | 64 ++++--------------- .../front_end/news_bulletins/show.html.erb | 64 ++++--------------- 4 files changed, 26 insertions(+), 105 deletions(-) diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index f127a73c..c3838827 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -27,6 +27,7 @@ <%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') %> <%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %> <%= content_tag :li, link_to(t('announcement.news_bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_sys_call_for_app('module_apps','edit','news') if (is_admin? rescue nil) %> <% end -%> <% end -%> diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 6ee09656..41d57cbb 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -3,7 +3,7 @@ module ParserCommon def menu_level(page, current, menu, edit = false) res = '' - if page.children.size > 0 + if page.ordered_and_visible_children.size > 0 res << "