forked from saurabh/personal-project
Fix a tag bug.
This commit is contained in:
parent
a816dcd88b
commit
a03c42b592
|
@ -86,7 +86,7 @@ class Project
|
||||||
pd_data = []
|
pd_data = []
|
||||||
fields_to_show.collect do |t|
|
fields_to_show.collect do |t|
|
||||||
if t == "project_title"
|
if t == "project_title"
|
||||||
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_project')}' target='_blank'>#{p.send(t)}" }
|
pd_data << { "data_title" => "<a href=\"#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_project')}\" target='_blank'>#{p.send(t)}</a>" }
|
||||||
elsif t == "period"
|
elsif t == "period"
|
||||||
date = p.duration
|
date = p.duration
|
||||||
pd_data << { "data_title" => date }
|
pd_data << { "data_title" => date }
|
||||||
|
@ -134,18 +134,18 @@ class Project
|
||||||
self.project_files.each do |project_file|
|
self.project_files.each do |project_file|
|
||||||
url = project_file.file.url
|
url = project_file.file.url
|
||||||
title = ((project_file.title.blank? ? File.basename(project_file.file.path) : project_file.title) rescue "")
|
title = ((project_file.title.blank? ? File.basename(project_file.file.path) : project_file.title) rescue "")
|
||||||
files << (url.nil? ? "" : "<li><a href='#{url}'' target='_blank'>#{title}</li>")
|
files << (url.nil? ? "" : "<li><a href=\"#{url}\" target='_blank'>#{title}</a></li>")
|
||||||
end
|
end
|
||||||
value = files.join("")
|
value = files.join("")
|
||||||
when "url"
|
when "url"
|
||||||
value = self.url.to_s.blank? ? "" : "<a href='#{self.url}'>#{self.url}</a>"
|
value = self.url.to_s.blank? ? "" : "<a href=\"#{self.url}\">#{self.url}</a>"
|
||||||
when "participator"
|
when "participator"
|
||||||
value = get_authors_show(self)
|
value = get_authors_show(self)
|
||||||
else
|
else
|
||||||
value = self.send(field) rescue ""
|
value = self.send(field) rescue ""
|
||||||
end
|
end
|
||||||
|
|
||||||
value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "<a href='#{value}' target='blank'>#{value}</a>" : value
|
value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "<a href=\"#{value}\" target='blank'>#{value}</a>" : value
|
||||||
|
|
||||||
{
|
{
|
||||||
"key"=>field,
|
"key"=>field,
|
||||||
|
|
Loading…
Reference in New Issue