Skip to content

Commit 7a01ea8

Browse files
committed
Update strains_helper.rb
1 parent c2c0b78 commit 7a01ea8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

app/helpers/strains_helper.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,18 @@ def strain_numbers_html(numbers, opts = {})
4040
str.url, sanitize(str.catalogue&.name), sanitize(str.number), ext
4141
]
4242
elsif str.is_a?(StrainCode::Number) && str.catalogue&.name.present?
43-
'<abbr title="%s - %s">%s</abbr>' % [
43+
('<abbr title="%s - %s">%s</abbr>' % [
4444
sanitize(str.catalogue.name),
4545
sanitize(str.accession),
4646
sanitize(str.number)
47-
]
47+
]) +
48+
if str.catalogue.url.present?
49+
' (<a href="%s" title="catalogue" target="_blank">cat %s</a>)' % [
50+
str.catalogue.url, ext
51+
]
52+
else
53+
''
54+
end
4855
else
4956
str
5057
end

0 commit comments

Comments
 (0)