Merge branch 'i18n_var' of github.com:Rulingcom/NCCU into i18n_var

Conflicts:
	app/controllers/pages_controller.rb
	app/models/item.rb
	app/models/site.rb
	config/environments/development.rb
	vendor/built_in_modules/announcement/app/models/bulletin.rb
This commit is contained in:
Christophe Vilayphiou 2012-07-27 19:21:39 +08:00
commit 23854e7adc
1 changed files with 30 additions and 30 deletions

View File

@ -46,7 +46,7 @@ class Bulletin
mount_uploader :image, ImageUploader
# belongs_to :unit_list_for_anc
# belongs_to :unit_list_for_anc
# embeds_many :bulletin_links, :cascade_callbacks => true
# embeds_many :bulletin_files, :cascade_callbacks => true
@ -64,46 +64,46 @@ class Bulletin
after_save :save_bulletin_links
after_save :save_bulletin_files
redis_search_index(:title_field => :s_title,
redis_search_index(:title_field => :s_title,
:alias_field =>:s_title_en ,
:score_field => :view_count,
:condition_fields => [:is_checked,:is_hidden,:bulletin_category_id],
:ext_fields => [])
# def gen_title_for_search
# # [s_title,s_title_en,s_text_en,s_text_zh_tw].join(' ')
# end
# def gen_title_for_search
# # [s_title,s_title_en,s_text_en,s_text_zh_tw].join(' ')
# end
def s_title
def s_title
self.title.zh_tw
end
end
def s_title_en
def s_title_en
self.title.en
end
end
# def s_text_en
# Nokogiri::HTML(self.text.en).text
# end
# def s_text_zh_tw
# Nokogiri::HTML(self.text.zh_tw).text
# end
# def s_text_en
# Nokogiri::HTML(self.text.en).text
# end
# def s_text_zh_tw
# Nokogiri::HTML(self.text.zh_tw).text
# end
# scope :currently_available, lambda { |category, limit|
# # limit ||= 5
# # {
# # debugger
# # a=1
# :where => {:bulletin_category_id => bulletin_category_id, :disable => false}#,
# # :limit => limit
# # }
# }
def de_pending
self.is_pending = false
end
# scope :currently_available, lambda { |category, limit|
# # limit ||= 5
# # {
# # debugger
# # a=1
# :where => {:bulletin_category_id => bulletin_category_id, :disable => false}#,
# # :limit => limit
# # }
# }
def de_pending
self.is_pending = false
end
def publish_month
published_at.strftime("%B %Y")
end
def publish_month
published_at.strftime("%B %Y")
end
def self.search( search = nil, category_id = nil )
if category_id.to_s.size > 0 and search.to_s.size > 0