Skip to content

Commit

Permalink
Add type specifications to wikispecies
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Jul 28, 2024
1 parent 67b0271 commit 15ea6f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/models/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,13 @@ def name_wiki(opts = {})
y = base_name
y = "[[#{y}]]" if opts[:link]
y = "''Candidatus'' #{y}" if !opts[:no_candidatus] && candidatus?
validated? ? "''#{y}''" : "\"#{y}\""
return "\"#{y}\"" unless validated?

y = "''#{y}''"
if rank == 'species' && parent&.type_accession&.==(id.to_s)
y += " T#{'s' unless icnp? || icn?}"
end
y
end

def abbr_corr_name
Expand Down
3 changes: 3 additions & 0 deletions app/views/names/wiki/_wikispecies_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Species: <%= @name.name_wiki(no_candidatus: true, link: true) %>
when 'species'
fmt = (name.genus&.base_name || '').split(//, 2).join('|')
fmt += '|' + (name.last_epithet || '')
if name.parent&.type_accession&.==(name.id.to_s)
fmt += '|T' + (name.seqcode? ? 's' : '')
end
'{{sp' + last + '|' + fmt + '}}'
when 'genus'
'{{g' + last + '|' + name.base_name + '}}'
Expand Down

0 comments on commit 15ea6f0

Please sign in to comment.