fixed json for nccu
This commit is contained in:
parent
eacafbcc86
commit
fc35327d11
|
@ -15,7 +15,7 @@ class Admin::NewsbulletinsController < ApplicationController
|
||||||
keyword = Regexp.new(".*"+params[:keyword]+".*")
|
keyword = Regexp.new(".*"+params[:keyword]+".*")
|
||||||
bulletins = NewsBulletin.any_of({:title=>keyword},{:subtitle=>keyword},{:text=>keyword})
|
bulletins = NewsBulletin.any_of({:title=>keyword},{:subtitle=>keyword},{:text=>keyword})
|
||||||
else
|
else
|
||||||
bulletins = NewsBulletin.all
|
bulletins = NewsBulletin.all.can_display
|
||||||
end
|
end
|
||||||
|
|
||||||
bulletins = bulletins.where(:is_hot => params[:is_hot]) if !params[:is_hot].blank?
|
bulletins = bulletins.where(:is_hot => params[:is_hot]) if !params[:is_hot].blank?
|
||||||
|
@ -53,7 +53,7 @@ class Admin::NewsbulletinsController < ApplicationController
|
||||||
end rescue nil
|
end rescue nil
|
||||||
|
|
||||||
text = {"en" => "", "zh_tw" => ""}
|
text = {"en" => "", "zh_tw" => ""}
|
||||||
text["en"] = (b.text_translations["en"].nil? ? "" :smart_convertor(b.text_translations["en"]))
|
text["en"] = (b.text_translations["en"].nil? ? "" : smart_convertor(b.text_translations["en"]))
|
||||||
text["zh_tw"] = (b.text_translations["zh_tw"].nil? ? "" : smart_convertor(b.text_translations["zh_tw"]))
|
text["zh_tw"] = (b.text_translations["zh_tw"].nil? ? "" : smart_convertor(b.text_translations["zh_tw"]))
|
||||||
|
|
||||||
author = User.find(b.create_user_id).member_profile.name rescue ""
|
author = User.find(b.create_user_id).member_profile.name rescue ""
|
||||||
|
|
Loading…
Reference in New Issue