sorting changed and added target for profile page
This commit is contained in:
parent
c2eaab894b
commit
d0d96f7168
|
@ -34,7 +34,7 @@ class Patent
|
||||||
|
|
||||||
before_validation :add_http
|
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)
|
def get_plugin_data(fields_to_show)
|
||||||
plugin_datas = []
|
plugin_datas = []
|
||||||
|
@ -88,7 +88,7 @@ class Patent
|
||||||
fields_to_show.collect do |t|
|
fields_to_show.collect do |t|
|
||||||
case t
|
case t
|
||||||
when "patent_title"
|
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"
|
when "publish_date"
|
||||||
pd_data << {"data_title" => (p.publish_date.strftime("%Y/%m/%d") rescue "")}
|
pd_data << {"data_title" => (p.publish_date.strftime("%Y/%m/%d") rescue "")}
|
||||||
when "application_date"
|
when "application_date"
|
||||||
|
|
Loading…
Reference in New Issue