Fix announcement page error.
This commit is contained in:
parent
b7c36af497
commit
dd67af744d
|
@ -244,7 +244,7 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
bulletin.save
|
||||
build_email(bulletin,I18n.locale)
|
||||
create_feed_cache(bulletin)
|
||||
redirect_to params['referer_url']
|
||||
redirect_to admin_announcements_path
|
||||
end
|
||||
|
||||
def approve_bulletin
|
||||
|
@ -324,19 +324,19 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
now_bulletin_page = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil])
|
||||
.order_by(sort).map(&:id).map.with_index.select{|v,i| v==bulletin.id}[0][1] rescue nil
|
||||
now_bulletin_page = now_bulletin_page.nil? ? 0 : ((now_bulletin_page+1).to_f/10).ceil
|
||||
redirect_to "/zh_tw/admin/announcements?page=#{now_bulletin_page}"
|
||||
redirect_to admin_announcements_path(:page=>now_bulletin_page)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@bulletin.destroy
|
||||
redirect_to "/admin/announcements"
|
||||
redirect_to admin_announcements_path
|
||||
end
|
||||
|
||||
def delete
|
||||
if params[:ids]
|
||||
Bulletin.any_in(:uid => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to "/admin/announcements"
|
||||
redirect_to admin_announcements_path
|
||||
end
|
||||
|
||||
def preview
|
||||
|
|
Loading…
Reference in New Issue