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]
|
@table_fields = [:status, :category, :title, :start_date, :end_date, "announcement.comment", :last_modified]
|
||||||
setting = AnnouncementSetting.first
|
setting = AnnouncementSetting.first
|
||||||
@annc_depts = []
|
@annc_depts = []
|
||||||
|
@enable_annc_dept = false
|
||||||
if (setting.enable_annc_dept rescue false)
|
if (setting.enable_annc_dept rescue false)
|
||||||
@table_fields.insert(1, "announcement.annc_dept")
|
@table_fields.insert(1, "announcement.annc_dept")
|
||||||
@annc_depts = setting.annc_depts
|
@annc_depts = setting.annc_depts
|
||||||
|
@enable_annc_dept = true
|
||||||
end
|
end
|
||||||
@current_user = current_user
|
@current_user = current_user
|
||||||
if setting.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)
|
||||||
|
|
|
@ -16,9 +16,11 @@
|
||||||
<td>
|
<td>
|
||||||
<%= b.status_for_table %>
|
<%= b.status_for_table %>
|
||||||
</td>
|
</td>
|
||||||
|
<% if @enable_annc_dept %>
|
||||||
<td>
|
<td>
|
||||||
<%= b.annc_dept ? @annc_depts[b.annc_dept] : '' rescue "" %>
|
<%= b.annc_dept ? @annc_depts[b.annc_dept] : '' rescue "" %>
|
||||||
</td>
|
</td>
|
||||||
|
<% end %>
|
||||||
<td>
|
<td>
|
||||||
<%= b.category.title rescue "" %>
|
<%= b.category.title rescue "" %>
|
||||||
<% if (b.category.disable rescue false) %>
|
<% if (b.category.disable rescue false) %>
|
||||||
|
|
Loading…
Reference in New Issue