From 33dba3f5076cab567bf3213047fb4987a177c1a5 Mon Sep 17 00:00:00 2001 From: "Luis M. Rodriguez-R" Date: Thu, 10 Oct 2024 17:21:06 -0500 Subject: [PATCH] Add templated genera titles in wiki source --- app/models/name.rb | 4 +++- app/views/names/wiki/_wikispecies_template.html.erb | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/models/name.rb b/app/models/name.rb index d8fe265..62d2c1d 100644 --- a/app/models/name.rb +++ b/app/models/name.rb @@ -519,11 +519,13 @@ def name_wiki(opts = {}) y = "''Candidatus'' #{y}" if !opts[:no_candidatus] && candidatus? return "\"#{y}\"" unless validated? + return "{{gbr|#{y}}}" if opts[:eol] && rank == 'genus' + y = "''#{y}''" if rank == 'species' && parent&.type_accession&.==(id.to_s) y += " (T#{'s' unless icnp? || icn?})" end - y + opts[:eol] ? "#{y} <br/>" : y end def abbr_corr_name diff --git a/app/views/names/wiki/_wikispecies_template.html.erb b/app/views/names/wiki/_wikispecies_template.html.erb index f9461a7..5db75a4 100644 --- a/app/views/names/wiki/_wikispecies_template.html.erb +++ b/app/views/names/wiki/_wikispecies_template.html.erb @@ -18,8 +18,9 @@ <%= Name.rank_variant(@name.rank_above, latin: true, title: true) %>: - <br/> <% end %> <% end %> -<%= Name.rank_variant(@name.inferred_rank, latin: true, title: true) - %>: <%= @name.name_wiki(link: true) %> <br/> +<%= + Name.rank_variant(@name.inferred_rank, latin: true, title: true) +%>: <%= @name.name_wiki(link: true, eol: true) %> <noinclude>[[Category:Taxonavigation templates]]</noinclude> <includeonly>[[Category:Pages with taxonavigation templates]]</includeonly>