diff --git a/app/controllers/admin/newsbulletins_controller.rb b/app/controllers/admin/newsbulletins_controller.rb index c417448..628ad58 100644 --- a/app/controllers/admin/newsbulletins_controller.rb +++ b/app/controllers/admin/newsbulletins_controller.rb @@ -22,6 +22,7 @@ class Admin::NewsbulletinsController < ApplicationController bulletins = bulletins.where(:category_id.in => params[:categories]) if !params[:categories].blank? bulletins = bulletins.where(:tagged_ids.in => params[:tags]) if !params[:tags].blank? bulletins = bulletins.where(:is_preview.in=>[false,nil]) + bulletins = bulletins.where(:approved.ne => false , :rejected.ne => true) bulletins = bulletins.desc( :is_top, :postdate).page(page_num).per(per_page) @@ -82,6 +83,7 @@ class Admin::NewsbulletinsController < ApplicationController bulletin_count = NewsBulletin.all end bulletin_count = bulletin_count.where(:is_preview.in=>[false,nil]) + bulletin_count = bulletin_count.where(:approved.ne => false , :rejected.ne => true) total_pages = bulletin_count.count # End diff --git a/app/views/admin/news/_form.html.erb b/app/views/admin/news/_form.html.erb index 96b2586..08acfb9 100644 --- a/app/views/admin/news/_form.html.erb +++ b/app/views/admin/news/_form.html.erb @@ -334,9 +334,11 @@ var fileupload_size_limit = fileupload_size_limit_mb*1000*1000; // 1MB $(function() { - var getDate = new Date(); - var toDay = getDate.getFullYear()+"/"+ (getDate.getMonth()+1)+"/"+getDate.getDate()+" "+getDate.getHours()+":"+getDate.getMinutes(); - $('input[name="news_bulletin[postdate]"]').val(toDay); + if (location.pathname.substr(-3)=='new'){ + var getDate = new Date(); + var toDay = getDate.getFullYear()+"/"+ (getDate.getMonth()+1)+"/"+getDate.getDate()+" "+getDate.getHours()+":"+getDate.getMinutes(); + $('input[name="news_bulletin[postdate]"]').val(toDay); + } $("#main-wrap").after("");