diff --git a/app/controllers/names_controller.rb b/app/controllers/names_controller.rb index 4c82f55b..b126fd71 100644 --- a/app/controllers/names_controller.rb +++ b/app/controllers/names_controller.rb @@ -374,9 +374,10 @@ def return # POST /names/1/validate def validate - if params[:code] == 'icnp' + if params[:code] == 'icnp' || params[:code] == 'icn' par = { - status: 20, validated_by: current_user, validated_at: Time.now + status: params[:code] == 'icnp' ? 20 : 25, + validated_by: current_user, validated_at: Time.now } if @name.validated? flash[:alert] = 'Name status is incompatible with validation' diff --git a/app/models/name.rb b/app/models/name.rb index 80f34076..c4e602d9 100644 --- a/app/models/name.rb +++ b/app/models/name.rb @@ -193,6 +193,14 @@ def status_hash This name has been validly published under the rules of the ICNP and has priority in the scientific record TXT + }, + 25 => { + symbol: :icn, name: 'Valid (ICN)', + public: true, valid: true, + help: <<~TXT + This name has been validly published under the rules of the ICN + and has priority in the scientific record + TXT } } end @@ -244,7 +252,7 @@ def abbr_name(name = nil, assume_valid = false) elsif (assume_valid || validated?) || inferred_rank == 'domain' "#{name}".html_safe + if rank == 'species' && parent&.type_accession&.==(id.to_s) - " T#{'s' unless icnp?}".html_safe + " T#{'s' unless icnp? || icn?}".html_safe else '' end @@ -262,7 +270,7 @@ def abbr_name_raw(name = nil, assume_valid = false) elsif (assume_valid || validated?) || inferred_rank == 'domain' "#{name}" + if rank == 'species' && parent&.type_accession&.==(id.to_s) - " (T#{'s' unless icnp?})" + " (T#{'s' unless icnp? || icn?})" else '' end @@ -280,7 +288,7 @@ def name_html(name = nil, assume_valid = false) elsif (assume_valid || validated?) || inferred_rank == 'domain' "#{name}".html_safe + if rank == 'species' && parent&.type_accession&.==(id.to_s) - "T#{'s' unless icnp?}".html_safe + "T#{'s' unless icnp? || icn?}".html_safe end else "“#{name}”".html_safe diff --git a/app/models/name/etymology.rb b/app/models/name/etymology.rb index 49ddc492..c7c583d0 100644 --- a/app/models/name/etymology.rb +++ b/app/models/name/etymology.rb @@ -66,7 +66,9 @@ def full_etymology(html = false) end def partial_etymology(component, html = false) - pre = [etymology(component, :lang), etymology(component, :grammar)].compact.join(' ') + pre = [ + etymology(component, :lang), etymology(component, :grammar) + ].compact.join(' ') pre = nil if pre.empty? par = etymology(component, :particle) des = etymology(component, :description) diff --git a/app/models/name/quality_checks.rb b/app/models/name/quality_checks.rb index cf27f37f..976ae613 100644 --- a/app/models/name/quality_checks.rb +++ b/app/models/name/quality_checks.rb @@ -387,8 +387,8 @@ class QcWarning # - Rule 22 [Checklist-N] # TODO: An automated test could be included, but it would rely on the # preferred taxonomy and would require estimates of priority dates - # for ICNP names. This would be very useful as the number of taxa - # grows larger. + # for ICNP and ICN names. This would be very useful as the number + # of taxa grows larger. later_taxon_as_type: { checklist: :nomenclature, message: 'The nomenclatural type must be the earliest legitimate taxon', diff --git a/app/views/names/_curator.html.erb b/app/views/names/_curator.html.erb index 6213b631..6eb01666 100644 --- a/app/views/names/_curator.html.erb +++ b/app/views/names/_curator.html.erb @@ -36,6 +36,17 @@ » Indicate that this name has already been validly published under the ICNP
+ <%= link_to( + validate_name_url(@name, code: :icn), + method: :post, + class: 'btn btn-primary btn-sm', + data: { confirm: 'Are you sure? This action cannot be undone' } + ) do %> + <%= fa_icon('stamp') %> Report valid under ICN + <% end %> + » Indicate that this name has been validly published under + the ICN (Botanical Code) +
<% if @name.after_submission? %> <%= link_to( return_name_url(@name),