This commit is contained in:
BoHung Chiu 2022-04-21 22:01:50 +08:00
parent 218dd21255
commit 920a8880ce
2 changed files with 4 additions and 0 deletions

View File

@ -60,9 +60,11 @@ class Admin::AnnouncementsController < OrbitAdminController
@table_fields = [:status, :category, :title, :start_date, :end_date, "announcement.comment", :last_modified]
setting = AnnouncementSetting.first
@annc_depts = []
@enable_annc_dept = false
if (setting.enable_annc_dept rescue false)
@table_fields.insert(1, "announcement.annc_dept")
@annc_depts = setting.annc_depts
@enable_annc_dept = true
end
@current_user = current_user
if setting.is_display_edit_only && !current_user.is_admin? && !current_user.is_manager?(@module_app)

View File

@ -16,9 +16,11 @@
<td>
<%= b.status_for_table %>
</td>
<% if @enable_annc_dept %>
<td>
<%= b.annc_dept ? @annc_depts[b.annc_dept] : '' rescue "" %>
</td>
<% end %>
<td>
<%= b.category.title rescue "" %>
<% if (b.category.disable rescue false) %>