Skip to content

Commit 8aaf1d4

Browse files
committed
Additional indication for incorrect names
1 parent 17670fe commit 8aaf1d4

2 files changed

Lines changed: 37 additions & 6 deletions

File tree

app/helpers/application_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,12 @@ def help_message(title = '', opts = {})
237237
help_button(id, opts)
238238
end
239239

240-
def help_button(id, opts)
240+
def help_button(id, opts = {})
241241
opts[:class] ||= ''
242+
opts[:icon] ||= 'question-circle'
242243
modal_button(id, opts) do
243244
content_tag(:b, opts[:text], class: 'text-info') +
244-
fa_icon('question-circle', class: 'hover-help')
245+
fa_icon(opts[:icon], class: 'hover-help')
245246
end
246247
end
247248

app/views/names/_title.html.erb

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@
2323
observe
2424
].compact)
2525
%>
26-
<h1><%= @name.name_html %></h1>
26+
<h1>
27+
<%= @name.name_html %>
28+
</h1>
29+
2730
<% unless @name.public? %>
28-
<span class="text-muted">
29-
<%= fa_icon('eye-slash') %> Only visible to you and curators
31+
<div class="text-muted">
32+
<%= fa_icon('eye-slash', class: 'mr-1') %>
33+
Only visible to you and curators
3034
<%= help_message('Name not public') do %>
3135
<div class="alert alert-warning">
3236
This name is undergoing the registration process, currently in the
@@ -45,7 +49,33 @@
4549
&raquo; Learn more about data release
4650
<% end %>
4751
<% end %>
48-
</span>
52+
</div>
53+
<% end %>
54+
55+
<% if @name.validated? && !@name.correct? %>
56+
<div class="text-muted">
57+
<%= fa_icon('times-circle', class: 'mr-1') %>
58+
Marked as incorrect name
59+
<%= help_message('Incorrect name') do %>
60+
<% if @name.illegitimate? %>
61+
This name has been marked as illegitimate, likely due to priority
62+
conflicts in its lineage.
63+
<% elsif @name.correct_name.present? %>
64+
This name has been marked as incorrect, with the correct name for this
65+
taxon being <%= display_link(@name.correct_name) %>.
66+
<% elsif @name.type_name_alt_placement.present? %>
67+
This name refers to a taxon that does not contain its nomenclatural
68+
type. If that taxonomic placement is correct, this name should be
69+
considered a synonym of
70+
<%= display_link(@name.type_name_alt_placement) %>.
71+
<% else %>
72+
This name has been marked as incorrect, but no further information is
73+
recorded. Please explore the name's page for additional information.
74+
<% end %>
75+
If you consider this to be a mistake, please
76+
<%= link_to('contact us', page_connect_url) %> to revise this assessment.
77+
<% end %>
78+
</div>
4979
<% end %>
5080
<hr/>
5181

0 commit comments

Comments
 (0)