Fix announcement page error.
This commit is contained in:
parent
b7c36af497
commit
dd67af744d
|
@ -244,7 +244,7 @@ class Admin::AnnouncementsController < OrbitAdminController
|
||||||
bulletin.save
|
bulletin.save
|
||||||
build_email(bulletin,I18n.locale)
|
build_email(bulletin,I18n.locale)
|
||||||
create_feed_cache(bulletin)
|
create_feed_cache(bulletin)
|
||||||
redirect_to params['referer_url']
|
redirect_to admin_announcements_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def approve_bulletin
|
def approve_bulletin
|
||||||
|
@ -324,19 +324,19 @@ class Admin::AnnouncementsController < OrbitAdminController
|
||||||
now_bulletin_page = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil])
|
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
|
.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
|
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
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@bulletin.destroy
|
@bulletin.destroy
|
||||||
redirect_to "/admin/announcements"
|
redirect_to admin_announcements_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
def delete
|
||||||
if params[:ids]
|
if params[:ids]
|
||||||
Bulletin.any_in(:uid => params[:ids]).destroy_all
|
Bulletin.any_in(:uid => params[:ids]).destroy_all
|
||||||
end
|
end
|
||||||
redirect_to "/admin/announcements"
|
redirect_to admin_announcements_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
|
|
Loading…
Reference in New Issue