ntue mail cron & log filter fix

This commit is contained in:
Spen 2013-07-02 14:47:10 +08:00 committed by Matt K. Fu
parent 7d6df11873
commit ec57cbff1c
7 changed files with 25 additions and 10 deletions

View File

@ -6,7 +6,14 @@ class Admin::MailCronLogsController < OrbitBackendController
def index def index
@mail_cron_logs = MailCronLog.all.desc(:created_at).page(params[:page_main] ).per('20') # @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
end end

View File

@ -6,7 +6,14 @@ class Admin::MailCronsController < OrbitBackendController
def index def index
@mail_logs = MailCron.all.asc(:mail_sentdate).page(params[:page_main] ).per('20') # @mail_crons = MailCron.all.asc(:mail_sentdate).page(params[:page_main] ).per('20')
@mail_crons = (params[:sort]) ? get_sorted_and_filtered("mail_cron") : get_viewable("mail_cron")
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @mail_crons }
format.js
end
end end

View File

@ -1,6 +1,6 @@
<%= render_sort_bar(true, delete_admin_mail_cron_logs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), <%= render_sort_bar(true, delete_admin_mail_cron_logs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
['subject', 'subject','span2', :subject] , ['subject', 'mail_subject','span2', :subject] ,
['mail_to', 'mail_to','span2', :mail_to] , ['mail_to', 'mail_to','span2', :mail_to] ,
['mail_user', 'mail_user','span2', :mail_user] , ['mail_user', 'mail_user','span2', :mail_user] ,
['mail_from_app', 'mail_from_app','span2', :mail_from_app] , ['mail_from_app', 'mail_from_app','span2', :mail_from_app] ,
['sentdate', 'sentdate','span2', :sentdate] ).html_safe %> ['sentdate', 'created_at','span2', :sentdate] ).html_safe %>

View File

@ -1,3 +1,4 @@
$("#delete_all").attr("action", "<%= delete_admin_mail_cron_logs_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>");
$("#sort_headers").html("<%= j render 'sort_headers' %>"); $("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#tbody_mail_cron_logs").html("<%= j render :partial => 'mail_cron_log', :collection => @mail_cron_logs %>"); $("#tbody_mail_cron_logs").html("<%= j render :partial => 'mail_cron_log', :collection => @mail_cron_logs %>");
$("#mail_cron_log_pagination").html("<%= j paginate @mail_cron_logs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>"); $("#mail_cron_log_pagination").html("<%= j paginate @mail_cron_logs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");

View File

@ -1,5 +1,5 @@
<%= render_sort_bar(true, delete_admin_mail_crons_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), <%= render_sort_bar(true, delete_admin_mail_crons_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
['subject', 'subject','span2', :subject] , ['subject', 'mail_subject','span2', :mail_subject] ,
['mail_to', 'mail_to','span2', :mail_to] , ['mail_to', 'mail_to','span2', :mail_to] ,
['mail_from_app', 'mail_from_app','span2', :mail_from_app] , ['mail_from_app', 'mail_from_app','span2', :mail_from_app] ,
['sentdate', 'sentdate','span2', :sentdate] ).html_safe %> ['sentdate', 'mail_sentdate','span2', :mail_sentdate] ).html_safe %>

View File

@ -1,4 +1,3 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %> <% end %>
@ -15,14 +14,14 @@
</tr> </tr>
</thead> </thead>
<tbody id="tbody_mail_crons" class="sort-holder"> <tbody id="tbody_mail_crons" class="sort-holder">
<%= render :partial => "mail_cron",:collection=> @mail_logs%> <%= render :partial => "mail_cron",:collection=> @mail_crons%>
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<div id="web_link_pagination" class="paginationFixed"> <div id="web_link_pagination" class="paginationFixed">
<%= paginate @mail_logs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @mail_crons, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -1,3 +1,4 @@
$("#delete_all").attr("action", "<%= delete_admin_mail_crons_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>");
$("#sort_headers").html("<%= j render 'sort_headers' %>"); $("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#tbody_mail_crons").html("<%= j render :partial => 'mail_cron', :collection => @mail_crons %>"); $("#tbody_mail_crons").html("<%= j render :partial => 'mail_cron', :collection => @mail_crons %>");
$("#mail_cron_pagination").html("<%= j paginate @mail_crons, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>"); $("#mail_cron_pagination").html("<%= j paginate @mail_crons, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");