fix json & postdate
This commit is contained in:
parent
15d1d867bf
commit
aeb3fb3fdb
|
@ -22,6 +22,7 @@ class Admin::BulletinsController < ApplicationController
|
||||||
bulletins = bulletins.where(:category_id.in => params[:categories]) if !params[:categories].blank?
|
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(:tagged_ids.in => params[:tags]) if !params[:tags].blank?
|
||||||
bulletins = bulletins.where(:is_preview.in=>[false,nil])
|
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)
|
bulletins = bulletins.desc( :is_top, :postdate).page(page_num).per(per_page)
|
||||||
|
|
||||||
|
@ -82,6 +83,7 @@ class Admin::BulletinsController < ApplicationController
|
||||||
bulletin_count = Bulletin.all
|
bulletin_count = Bulletin.all
|
||||||
end
|
end
|
||||||
bulletin_count = bulletin_count.where(:is_preview.in=>[false,nil])
|
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
|
total_pages = bulletin_count.count
|
||||||
# End
|
# End
|
||||||
|
|
||||||
|
|
|
@ -226,10 +226,13 @@
|
||||||
|
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var getDate = new Date();
|
if (location.pathname.substr(-3)=='new'){
|
||||||
var toDay = getDate.getFullYear()+"/"+ (getDate.getMonth()+1)+"/"+getDate.getDate()+" "+getDate.getHours()+":"+getDate.getMinutes();
|
var getDate = new Date();
|
||||||
$('input[name="bulletin[postdate]"]').val(toDay);
|
var toDay = getDate.getFullYear()+"/"+ (getDate.getMonth()+1)+"/"+getDate.getDate()+" "+getDate.getHours()+":"+getDate.getMinutes();
|
||||||
|
$('input[name="bulletin[postdate]"]').val(toDay);
|
||||||
|
}
|
||||||
|
|
||||||
$("#main-wrap").after("");
|
$("#main-wrap").after("");
|
||||||
|
|
||||||
|
|
Reference in New Issue