sorting changed and added target for profile page

This commit is contained in:
Harry Bomrah 2016-04-13 15:30:32 +08:00
parent c2eaab894b
commit d0d96f7168
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class Patent
before_validation :add_http
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc") }
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc", :application_date => "desc") }
def get_plugin_data(fields_to_show)
plugin_datas = []
@ -88,7 +88,7 @@ class Patent
fields_to_show.collect do |t|
case t
when "patent_title"
pd_data << {"data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_patent')}'>" + (p.send(t) rescue "") + "</a>"}
pd_data << {"data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_patent')}' taget='_blank'>" + (p.send(t) rescue "") + "</a>"}
when "publish_date"
pd_data << {"data_title" => (p.publish_date.strftime("%Y/%m/%d") rescue "")}
when "application_date"