Skip to content

Commit

Permalink
Merge pull request #47 from metagenlab/nj/fix_fam_amr
Browse files Browse the repository at this point in the history
Fix hmm link representation in AMR details view.
  • Loading branch information
njohner authored Jan 19, 2024
2 parents 5ba57ed + a073322 commit c4b45d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/templates/chlamdb/fam.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h3 class="panel-title">Description</h3>
{% for key, value in info.items %}
<tr>
<th>{{key}}</th>
<td>{{value}}</td>
<td>{{value|safe}}</td>
</tr>
{% endfor %}

Expand Down
6 changes: 5 additions & 1 deletion webapp/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,14 @@ def format_amr(gene, to_url=False):
return f"<a href=\"/fam_amr/{gene}\">{gene}</a>"


icon_external_link = '<i class="fas fa-external-link-alt"></i>'


def format_hmm_url(hmm_id):
if hmm_id:
hmm_id = hmm_id.rsplit(".", 1)[0]
return f"<a href=\"https://www.ncbi.nlm.nih.gov/genome/annotation_prok/evidence/{hmm_id}\">{hmm_id}</a>" # noqa
return f'<a href="https://www.ncbi.nlm.nih.gov/genome/annotation_prok/evidence/{hmm_id}"'\
f' target="_blank">{hmm_id}&nbsp{icon_external_link}</a>' # noqa
return hmm_id


Expand Down

0 comments on commit c4b45d5

Please sign in to comment.