Fix bug.
This commit is contained in:
parent
218dd21255
commit
920a8880ce
|
@ -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)
|
||||
|
|
|
@ -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) %>
|
||||
|
|
Loading…
Reference in New Issue