Skip to content

Commit

Permalink
Add incertae sedis logic to wikispecies
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Jul 28, 2024
1 parent 57e6f0e commit f6d86a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ def rank_variant(rank, opts = {})
if opts[:plural]
{
domain: 'dominia', kingdom: 'regna', phylum: 'phyla',
class: 'classis', order: 'ordines', family: 'familiae',
class: 'classes', order: 'ordines', family: 'familiae',
genus: 'genera', species: 'species', subspecies: 'subspecies'
}
else
{
domain: 'dominium', kingdom: 'regnum', phylum: 'phylum',
class: 'classes', order: 'ordo', family: 'familia',
class: 'classis', order: 'ordo', family: 'familia',
genus: 'genus', species: 'species', subspecies: 'subspecies'
}
end
Expand Down
10 changes: 10 additions & 0 deletions app/views/names/wiki/_wikispecies_template.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
<% end %>
<%= Name.rank_variant(@name.inferred_rank, latin: true, title: true)
%>: <%= @name.name_wiki(link: true) %> &lt;br/&gt;
<% elsif @name.incertae_sedis? %>
<% @name.lineage.each do |ancestor| %>
<% if ancestor.inferred_rank == 'domain' %>
{{<%= ancestor.base_name %>}}
<% else %>
<%= Name.rank_variant(ancestor.inferred_rank, latin: true, title: true) %>:
<%= ancestor.name_wiki(link: true) %>
<% end %>
<%= Name.rank_variant(@name.rank_above, latin: true, title: true) %>: -
<% end %>
<% end %>

&lt;noinclude&gt;[[Category:Taxonavigation templates]]&lt;/noinclude&gt;
Expand Down

0 comments on commit f6d86a6

Please sign in to comment.