From 697541fb45bb5e074ec0cd6bde6cfc42d3bd34e7 Mon Sep 17 00:00:00 2001 From: Anish Reddy Ravula <2anishreddy@gmail.com> Date: Mon, 2 Oct 2023 14:57:21 -0500 Subject: [PATCH 1/3] Show Version's stats along with Artifact's stats in artifact detail page The artifact details page shows version's stats which is confusing as the list page shows artifac's stats and the details page shows different numbers Also update tool tip for artifact to show 'last updated' and for version stats to show 'created_at' --- .../templates/sharing_portal/detail.html | 9 ++++++- .../sharing_portal/includes/stats.html | 26 ++++++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/sharing_portal/templates/sharing_portal/detail.html b/sharing_portal/templates/sharing_portal/detail.html index c1d2a5b5..4b47ede6 100644 --- a/sharing_portal/templates/sharing_portal/detail.html +++ b/sharing_portal/templates/sharing_portal/detail.html @@ -47,7 +47,10 @@

{{ artifact.long_description|markdown|safe }} - {% include 'sharing_portal/includes/stats.html' with artifact=artifact version=version %} +
+

Artifact stats

+ {% include 'sharing_portal/includes/stats.html' with artifact=artifact version=None %} +
{% if artifact.authors %}
@@ -146,6 +149,10 @@

Versions

{% endfor %} +

Version Stats

+
+ {% include 'sharing_portal/includes/stats.html' with artifact=artifact version=version sidebar=True %} +
{% endblock %} diff --git a/sharing_portal/templates/sharing_portal/includes/stats.html b/sharing_portal/templates/sharing_portal/includes/stats.html index c6bf848f..eebaff04 100644 --- a/sharing_portal/templates/sharing_portal/includes/stats.html +++ b/sharing_portal/templates/sharing_portal/includes/stats.html @@ -33,17 +33,19 @@ {% load trovi_filters %} {{ artifact.updated_at | trovi_date_format }} -
- {% for label in artifact.tags %} - {{ label }} - {% endfor %} - {% for badge in artifact.badges %} - - {% with 'images/'|add:badge.badge.name|add:'-logo-small.png' as logo_static %} - Small {{badge.badge.name}} logo - {% endwith %} - - {% endfor %} + {% if not sidebar %} +
+ {% for label in artifact.tags %} + {{ label }} + {% endfor %} + {% for badge in artifact.badges %} + + {% with 'images/'|add:badge.badge.name|add:'-logo-small.png' as logo_static %} + Small {{badge.badge.name}} logo + {% endwith %} + + {% endfor %} -
+
+ {% endif %} From 0e35eef5360194a09264fc1fa182771a46183108 Mon Sep 17 00:00:00 2001 From: Anish Reddy Ravula <2anishreddy@gmail.com> Date: Mon, 2 Oct 2023 15:00:45 -0500 Subject: [PATCH 2/3] Do not show last updated and version count for version stats --- sharing_portal/templates/sharing_portal/includes/stats.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sharing_portal/templates/sharing_portal/includes/stats.html b/sharing_portal/templates/sharing_portal/includes/stats.html index eebaff04..ae96b129 100644 --- a/sharing_portal/templates/sharing_portal/includes/stats.html +++ b/sharing_portal/templates/sharing_portal/includes/stats.html @@ -29,9 +29,11 @@ - {% endif %} - {{ artifact.versions | length }} {% load trovi_filters %} - {{ artifact.updated_at | trovi_date_format }} + {% if not version %} + {{ artifact.versions | length }} + {{ artifact.updated_at | trovi_date_format }} + {% endif %} {% if not sidebar %}
From f626311d8f27478aa1cb908e9c97239da0dae026 Mon Sep 17 00:00:00 2001 From: Anish Reddy Ravula <2anishreddy@gmail.com> Date: Mon, 2 Oct 2023 15:14:24 -0500 Subject: [PATCH 3/3] remove artifact stats section header as users expect the stats to be for the artifact --- sharing_portal/templates/sharing_portal/detail.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sharing_portal/templates/sharing_portal/detail.html b/sharing_portal/templates/sharing_portal/detail.html index 4b47ede6..7aa51ec5 100644 --- a/sharing_portal/templates/sharing_portal/detail.html +++ b/sharing_portal/templates/sharing_portal/detail.html @@ -47,10 +47,7 @@

{{ artifact.long_description|markdown|safe }}

-
-

Artifact stats

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