2013-06-17 10:22:24 +00:00
|
|
|
class Admin::MailCronLogsController < OrbitBackendController
|
|
|
|
|
|
|
|
layout "new_admin"
|
|
|
|
before_filter :authenticate_user!
|
|
|
|
before_filter :is_admin?
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
2013-07-02 06:47:10 +00:00
|
|
|
# @mail_cron_logs = MailCronLog.all.desc(:created_at).page(params[:page_main] ).per('20')
|
|
|
|
@mail_cron_logs = (params[:sort]) ? get_sorted_and_filtered("mail_cron_log") : get_viewable("mail_cron_log")
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html # index.html.erb
|
|
|
|
format.xml { render :xml => @mail_crons }
|
|
|
|
format.js
|
|
|
|
end
|
2013-06-17 10:22:24 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
@mail_cron_log = MailCronLog.find(params[:id])
|
|
|
|
@mail_cron_log.destroy
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { redirect_to(admin_mail_cron_logs_url) }
|
|
|
|
# format.xml { head :ok }
|
|
|
|
format.js
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def delete
|
|
|
|
if params[:ids]
|
|
|
|
mail_cron_logs = MailCronLog.any_in(:_id => params[:ids]).destroy_all
|
|
|
|
end
|
|
|
|
redirect_to admin_mail_cron_logs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|