From 5b0e1aed02d929403fb20635323b02364ace1187 Mon Sep 17 00:00:00 2001 From: nccu Date: Tue, 30 Dec 2014 09:49:18 +0800 Subject: [PATCH] fix deadline & add word --- app/controllers/announcements_controller.rb | 10 +++++----- app/views/admin/announcements/_form.html.erb | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 26c190c..0d25171 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -7,25 +7,25 @@ class AnnouncementsController < ApplicationController if params[:keywords] !params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"} - announcements = Bulletin.where(:title.ne => "").any_of(:title => /#{params[:keywords].to_s}/i).can_display.is_approved.order_by(sort).filter_by_categories(["all"]).per(15) if !params[:keywords].nil? + announcements = Bulletin.where(:title.ne => "").any_of(:title => /#{params[:keywords].to_s}/i).is_approved.order_by(sort).filter_by_categories(["all"]).per(15) if !params[:keywords].nil? announcements_count = announcements.count keyword = params[:keywords] elsif params[:unit] !params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"} - announcements = Bulletin.where(:title.ne => "" ,:cache_dept => params[:unit].to_s).can_display.is_approved.order_by(sort).filter_by_categories(["all"]).per(15) if !params[:unit].nil? + announcements = Bulletin.where(:title.ne => "" ,:cache_dept => params[:unit].to_s).is_approved.order_by(sort).filter_by_categories(["all"]).per(15) if !params[:unit].nil? announcements_count = announcements.count keyword = params[:unit] elsif params[:tag] !params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"} - announcements = Bulletin.where(:title.ne => "" ,:is_preview.in=>[false,nil]).can_display.is_approved.order_by(sort).filter_by_categories(["all"]).filter_by_tags([params[:tag]]) + announcements = Bulletin.where(:title.ne => "" ,:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_categories(["all"]).filter_by_tags([params[:tag]]) else sort = ( !params[:sort].blank? ? {params[:sort].to_sym=>params[:order]} : {:postdate=>"desc"}) # announcements = Bulletin.where(:title.ne => "" ,:is_preview.in=>[false,nil]).can_display.is_approved.order_by(sort).filter_by_categories.filter_by_tags(OrbitHelper.page_tags) if OrbitHelper.page_categories.first == "all" - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).can_display.is_approved.order_by(sort).filter_by_tags.page(params[:page_no]).per(OrbitHelper.page_data_count) + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_tags.page(params[:page_no]).per(OrbitHelper.page_data_count) else - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).can_display.is_approved.filter_by_categories.filter_by_tags.can_display.order_by(sort).page(params[:page_no]).per(OrbitHelper.page_data_count) + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.filter_by_categories.filter_by_tags.order_by(sort).page(params[:page_no]).per(OrbitHelper.page_data_count) end end page = Page.where(:module => "announcement").first rescue nil diff --git a/app/views/admin/announcements/_form.html.erb b/app/views/admin/announcements/_form.html.erb index 49298ec..dc961fa 100644 --- a/app/views/admin/announcements/_form.html.erb +++ b/app/views/admin/announcements/_form.html.erb @@ -125,6 +125,8 @@ ※內文裡單一圖片大小為1MB以下。
※內文裡單一圖片尺寸的最大寬度600px(滿版),如圖片要縮小,請依比例調整。 +
+ ※新聞及公告發佈後台請增加下列文字:建議使用IE10、IE11、Chrome(最佳)、Firefox等瀏覽器。
<%= f.fields_for :text_translations do |f| %>