Fixing non-local links

This commit is contained in:
Oliver Kennedy 2016-08-10 11:32:33 -04:00
parent 41ed9f959a
commit 5e42d9008e
2 changed files with 7 additions and 2 deletions

View file

@ -2,7 +2,7 @@
"members" : {
"Oliver Kennedy" : {
"status" : "Faculty",
"ubit" : "okennedy"
"ubit" : "okennedy"
},
"Ying Yang" : {
"status" : "PhD",

View file

@ -55,7 +55,12 @@ module LabMetadata
def LabMetadata.link_for(person)
cname = @@cnames[person] || person
data = $db["lab/members"][cname]
if data.nil? then person else "<a class=\"lab_member\" href=\"#{GemSmith::root_path(data["link"])}\">#{person}</a>" end
if data.nil? then person else
link =
if /^https?:\/\// =~ data["link"] then data["link"]
else GemSmith::root_path(data["link"]) end
"<a class=\"lab_member\" href=\"#{link}\">#{person}</a>"
end
end
def LabMetadata.publications_for(person)