Skip to content

Commit fdc57f0

Browse files
committed
Update _samples.html.erb
1 parent 66e8e3f commit fdc57f0

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

app/views/genomes/_samples.html.erb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,17 @@
4242
case group
4343
when :environment
4444
osl4 = 'https://www.ebi.ac.uk/ols4/ontologies/envo/classes/'
45-
purl = 'http://purl.obolibrary.org/obo/ENVO_'
46-
envo = osl4 + ERB::Util.u(purl)
47-
purl = 'http://purl.obolibrary.org/obo/PCO_'
48-
pco = osl4 + ERB::Util.u(purl)
4945
v.map! do |i|
50-
sanitize(i)
51-
.gsub(
52-
/(^\s*|[^A-Z\d])ENVO:(\d{8})(\s*$|[^A-Z\d])/i,
53-
"\\1<a href='#{envo}\\2' target=_blank>ENVO:\\2</a>\\3"
54-
)
55-
.gsub(
56-
/(^\s*|[^A-Z\d])PCO:(\d{7})(\s*$|[^A-Z\d])/i,
57-
"\\1<a href='#{pco}\\2' target=_blank>PCO:\\2</a>\\3"
46+
y = sanitize(i)
47+
%w[ENVO PCO OBERON OHMI].each do |ont|
48+
purl = "http://purl.obolibrary.org/obo/#{ont}_"
49+
o_url = osl4 + ERB::Util.u(purl)
50+
y = y.gsub(
51+
/(^\s*|[^A-Z\d])#{ont}[:_](\d{8})(\s*$|[^A-Z\d])/i,
52+
"\\1<a href='#{o_url}\\2' target=_blank>ENVO:\\2</a>\\3"
5853
)
54+
end
55+
y
5956
end
6057
when :toponym
6158
mrg = 'http://marineregions.org/mrgid/'

0 commit comments

Comments
 (0)