fix bug.
This commit is contained in:
parent
308302fdb9
commit
5ae0c57a1a
|
@ -14,12 +14,12 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
def index
|
||||
Bulletin.remove_expired_status
|
||||
@tags = @module_app.tags
|
||||
@categories = @module_app.categories.enabled
|
||||
@filter_fields = filter_fields(@categories, @tags)
|
||||
@table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified]
|
||||
if AnnouncementSetting.first.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 []
|
||||
@filter_fields = filter_fields(@categories, @tags)
|
||||
@bulletins = Bulletin.where(:create_user_id=>current_user.id,:title.ne => "",:is_preview.in=>[false,nil])
|
||||
.order_by(sort)
|
||||
.with_categories(filters("category"))
|
||||
|
@ -27,8 +27,12 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
.with_status(filters("status"))
|
||||
else
|
||||
@bulletins = Bulletin.where(:uid=>nil)
|
||||
@categories = @module_app.categories.enabled
|
||||
@filter_fields = filter_fields(@categories, @tags)
|
||||
end
|
||||
else
|
||||
@categories = @module_app.categories.enabled
|
||||
@filter_fields = filter_fields(@categories, @tags)
|
||||
@bulletins = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil])
|
||||
.order_by(sort)
|
||||
.with_categories(filters("category"))
|
||||
|
|
Loading…
Reference in New Issue