diff --git a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb new file mode 100644 index 00000000..5dcf39d3 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb @@ -0,0 +1,9 @@ +module Panel::Announcement::BackEnd::BulletinsHelper + + def show_approval_link(bulletin) + by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?) + by_user = bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? + by_bulletin and by_user + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb index 7a096ad0..b8dd663d 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb @@ -39,7 +39,7 @@ <%#= debugger %> <%#= a=1 %> - <% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %> + <% if show_approval_link(bulletin) %>