Skip to content

Commit 6fac729

Browse files
committed
Show wikidata links
1 parent 09c515e commit 6fac729

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

app/models/name.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,8 @@ def links?
607607
return true if public? # <- return Wikispecies for all public names
608608

609609
ncbi_taxonomy? || gtdb_genome? || !gbif_homonyms(false, true).empty? ||
610-
lpsn_url? || gtdb_accession? || algaebase_url.present?
610+
lpsn_url? || gtdb_accession? || algaebase_url.present? ||
611+
wikidata_url.present?
611612
end
612613

613614
def gtdb_genome?
@@ -656,6 +657,12 @@ def ncbi_genomes_url
656657
'https://www.ncbi.nlm.nih.gov/datasets/genome/?taxon=%i' % ncbi_taxonomy
657658
end
658659

660+
def wikidata_url
661+
return unless wikidata_item?
662+
663+
'https://www.wikidata.org/wiki/%s' % wikidata_item
664+
end
665+
659666
def seqcode_url(protocol = true)
660667
"#{'https://' if protocol}seqco.de/i:#{id}"
661668
end

app/views/names/_metadata.html.erb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@
7272
</li>
7373
<% end %>
7474

75+
<% if @name.wikidata_url.present? %>
76+
<li>
77+
<%= link_to(@name.wikidata_url, target: '_blank') do %>
78+
WikiData <%= @name.wikidata_item %>
79+
<%= fa_icon('external-link-alt') %>
80+
<% end %>
81+
</li>
82+
<% end %>
83+
7584
<% if @name.public? %>
7685
<li>
7786
<%= link_to(@name.wikispecies_url, target: '_blank') do %>

0 commit comments

Comments
 (0)