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

Artifact stats detail page confusion fix #424

Merged
merged 3 commits into from
Oct 2, 2023
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
6 changes: 5 additions & 1 deletion sharing_portal/templates/sharing_portal/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2 class="artifactTitle">
{{ artifact.long_description|markdown|safe }}
</section>

{% include 'sharing_portal/includes/stats.html' with artifact=artifact version=version %}
{% include 'sharing_portal/includes/stats.html' with artifact=artifact version=None %}

{% if artifact.authors %}
<section class="artifactBody__authors">
Expand Down Expand Up @@ -146,6 +146,10 @@ <h4><i class="fa fa-files-o"></i> Versions</h4>
{% endfor %}
</ol>
</div>
<h4>Version Stats</h4>
<div style="margin-left: 0.5em">
{% include 'sharing_portal/includes/stats.html' with artifact=artifact version=version sidebar=True %}
</div>
</div>
</div>
{% endblock %}
32 changes: 18 additions & 14 deletions sharing_portal/templates/sharing_portal/includes/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@
-
{% endif %}
</span>
<span data-toggle="tooltip" data-placement="top" title="Versions - number of published versions"><i class="fa fa-files-o"></i> {{ artifact.versions | length }}</span>
{% load trovi_filters %}
<span class="artifactStats__updated">{{ artifact.updated_at | trovi_date_format }}</span>
{% if not version %}
<span data-toggle="tooltip" data-placement="top" title="Versions - number of published versions"><i class="fa fa-files-o"></i> {{ artifact.versions | length }}</span>
<span data-toggle="tooltip" data-placement="top" title="Last Updated" class="artifactStats__updated">{{ artifact.updated_at | trovi_date_format }}</span>
{% endif %}
</div>
<div class="artifactStats__labels">
{% for label in artifact.tags %}
<a href="{% url 'sharing_portal:index_all' %}?filter=tag:{{ label|urlencode }}">{{ label }}</a>
{% endfor %}
{% for badge in artifact.badges %}
<a href="{% url 'sharing_portal:index_all' %}?filter=badge:{{ badge.badge.name|urlencode }}" class="artifactStats__chameleonSupported" title="{{badge.badge.description}}">
{% with 'images/'|add:badge.badge.name|add:'-logo-small.png' as logo_static %}
<img src="{% static logo_static %}" alt="Small {{badge.badge.name}} logo">
{% endwith %}
</a>
{% endfor %}
{% if not sidebar %}
<div class="artifactStats__labels">
{% for label in artifact.tags %}
<a href="{% url 'sharing_portal:index_all' %}?filter=tag:{{ label|urlencode }}">{{ label }}</a>
{% endfor %}
{% for badge in artifact.badges %}
<a href="{% url 'sharing_portal:index_all' %}?filter=badge:{{ badge.badge.name|urlencode }}" class="artifactStats__chameleonSupported" title="{{badge.badge.description}}">
{% with 'images/'|add:badge.badge.name|add:'-logo-small.png' as logo_static %}
<img src="{% static logo_static %}" alt="Small {{badge.badge.name}} logo">
{% endwith %}
</a>
{% endfor %}

</div>
</div>
{% endif %}
</div>
Loading