add sync_data
This commit is contained in:
1 parent
39386930ef
commit
ce2ec4fc1a
4 files changed
+236
-1
No files matched your search
@@ -166,5 +166,25 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
def bulletins_search_block
|
||||
@part = PagePart.find params[:part_id]
|
||||
end
|
||||
|
||||
|
||||
|
||||
def sync_data
|
||||
@create_users = ( params[:dept].blank? or !params[:dept].kind_of?(Array)) ? [] : User.where(:sid.in => params[:dept]).collect{|p| p.id}
|
||||
@page_num = params[:page_num].blank? ? '10' : params[:page_num]
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.nin => ['53abbd0b45ef444e6a0001a0','53abbd2045ef444e6a00095d','53abbd0745ef444e6a000001'], :create_user_id.in => @create_users).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
end
|
||||
|
||||
def show_sync_data
|
||||
@bulletin = Bulletin.all.can_display.where(_id: params[:id]).first
|
||||
if @bulletin and !@bulletin.disable?
|
||||
if @bulletin.enabled_for_lang(I18n.locale.to_s)
|
||||
impressionist(@bulletin)
|
||||
else
|
||||
render :text => "<div class='alert alert-error'>#{t('sys.can_not_display_due_to_no_context')}</div>".html_safe
|
||||
end
|
||||
else
|
||||
render :nothing => true, :status => 403
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user