Skip to content

Commit

Permalink
Donot show private icon if doi (#425)
Browse files Browse the repository at this point in the history
* Do not show private icon if any of the versions have DOI

add has_doi field to artifact by looking at versions for doi

* black formatting

* undo new line
  • Loading branch information
AnishReddyRavula authored Oct 6, 2023
1 parent 7af7e1b commit 5a49c37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sharing_portal/templates/sharing_portal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3>Featured Artifacts</h3>
<h5 class="cardItem__title">
<span class="cardTitleTitle">{{ artifact.title }}</span>
<span class="cardTitlePrivate">
{% if artifact.is_private %}
{% if artifact.is_private and not artifact.has_doi %}
<i class="fa fa-eye-slash" data-toggle="tooltip" data-placement="top"
title="This artifact is only visible for those chosen by the author"></i>
{% endif %}
Expand Down Expand Up @@ -62,7 +62,7 @@ <h3>All Artifacts</h3>
<h5 class="cardItem__title">
<span class="cardTitleTitle">{{ artifact.title }}</span>
<span class="cardTitlePrivate">
{% if artifact.is_private %}
{% if artifact.is_private and not artifact.has_doi %}
<i class="fa fa-eye-slash" data-toggle="tooltip" data-placement="top"
title="This artifact is only visible for those chosen by the author"></i>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions sharing_portal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def _compute_artifact_fields(artifact):
terms.extend([f"badge:{badge.badge.name}" for badge in artifact["badges"]])
artifact["search_terms"] = terms
artifact["is_private"] = artifact["visibility"] == "private"
artifact["has_doi"] = any([_parse_doi(version) for version in artifact["versions"]])
return artifact


Expand Down

0 comments on commit 5a49c37

Please sign in to comment.