Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix bioportal link generation and remove redundant links #2655

Merged
merged 6 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions _layouts/ontology_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,44 @@ <h1>
<a href="http://www.ebi.ac.uk/ols/ontologies/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
OLS
</a>
<a href="https://bioportal.bioontology.org/ontologies/{{ page.id | make_bioportal_id }}" class="btn btn-outline-primary" target="_blank" rel="noopener">
BioPortal
</a>
{% assign skip_bioportal = false %}
{% for browser in page.browsers %}
{% if browser.label == "BioPortal" %}
{% assign skip_bioportal = true %}
{% endif %}
{% endfor %}

{% unless skip_bioportal %}
{% assign bioportal_id = page.id | upcase %}
{% if bioportal_id == 'FBBT' %}
{% assign bioportal_id = 'FB-BT' %}
{% elsif bioportal_id == 'RO' %}
{% assign bioportal_id = 'OBOREL' %}
{% elsif bioportal_id == 'APOLLO_SV' %}
{% assign bioportal_id = 'APOLLO-SV' %}
{% elsif bioportal_id == 'TRANS' %}
{% assign bioportal_id = 'PTRANS' %}
{% elsif bioportal_id == 'WBLS' %}
{% assign bioportal_id = 'WB-LS' %}
{% elsif bioportal_id == 'FBDV' %}
{% assign bioportal_id = 'FB-DV' %}
{% elsif bioportal_id == 'WBBT' %}
{% assign bioportal_id = 'WB-BT' %}
{% elsif bioportal_id == 'WBPHENOTYPE' %}
{% assign bioportal_id = 'WB-PHENOTYPE' %}
{% elsif bioportal_id == 'TO' %}
{% assign bioportal_id = 'PTO' %}
{% elsif bioportal_id == 'FBCV' %}
{% assign bioportal_id = 'FB-CV' %}
{% elsif bioportal_id == 'MOD' %}
{% assign bioportal_id = 'PSIMOD' %}
{% elsif bioportal_id == 'PSO' %}
{% assign bioportal_id = 'PLANTSO' %}
{% endif %}
<a href="https://bioportal.bioontology.org/ontologies/{{ bioportal_id }}" class="btn btn-outline-primary" target="_blank" rel="noopener">
BioPortal
</a>
{% endunless %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait the way you do it, if a bioportal link is manually set, wont they now see no button at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't believe so --

Lines 73 through 78 set a local skip_bioportal variable. If it's false, then lines 80-110 render a BioPortal button, but if it's true, then that's skipped. Regardless, 111-115 render custom buttons for each set of values defined in the ontology's front matter.

{% for b in page.browsers %}
<a href="{{b.url}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
{{b.label}}
</a>
{% endfor %}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eg here's my local render of PRO

Screenshot 2024-11-25 at 1 22 17 PM

{% for b in page.browsers %}
<a href="{{b.url}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
{{b.label}}
Expand Down
28 changes: 0 additions & 28 deletions _plugins/bioportal_identifier.rb

This file was deleted.