diff --git a/app/controllers/admin/announcements_controller.rb b/app/controllers/admin/announcements_controller.rb index 1ecfffa..fa0ec6c 100644 --- a/app/controllers/admin/announcements_controller.rb +++ b/app/controllers/admin/announcements_controller.rb @@ -58,8 +58,14 @@ class Admin::AnnouncementsController < OrbitAdminController Bulletin.remove_expired_status @tags = @module_app.tags @table_fields = [:status, :category, :title, :start_date, :end_date, "announcement.comment", :last_modified] + setting = AnnouncementSetting.first + @annc_depts = [] + if (setting.enable_annc_dept rescue false) + @table_fields.insert(1, "announcement.annc_dept") + @annc_depts = setting.annc_depts + end @current_user = current_user - if AnnouncementSetting.first.is_display_edit_only && !current_user.is_admin? && !current_user.is_manager?(@module_app) + if setting.is_display_edit_only && !current_user.is_admin? && !current_user.is_manager?(@module_app) current_user_is_sub_manager = !current_user.is_manager?(@module_app) && (current_user.is_sub_manager?(@module_app) || current_user.is_sub_manager_with_role?(@module_app)) rescue false if current_user_is_sub_manager @categories = current_user.approved_categories.select{|c| c.module_app_id == @module_app.id} rescue [] diff --git a/app/views/admin/announcements/_index.html.erb b/app/views/admin/announcements/_index.html.erb index 4c06f3a..39536cf 100644 --- a/app/views/admin/announcements/_index.html.erb +++ b/app/views/admin/announcements/_index.html.erb @@ -16,6 +16,9 @@ <%= b.status_for_table %> + + <%= b.annc_dept ? @annc_depts[b.annc_dept] : '' rescue "" %> + <%= b.category.title rescue "" %> <% if (b.category.disable rescue false) %>