From c71be06b0107431fc8f8784a35f8601a3ce7b5d7 Mon Sep 17 00:00:00 2001 From: Joseph Muller Date: Wed, 29 Jan 2025 13:13:03 +0000 Subject: [PATCH] fix #4299 Hide downloads if no downloadable galleys --- src/themes/OLH/templates/journal/article.html | 31 ++++++++++--------- .../clean/templates/journal/article.html | 4 ++- .../material/templates/journal/article.html | 14 +++++---- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/themes/OLH/templates/journal/article.html b/src/themes/OLH/templates/journal/article.html index 032dda760..3acb3714b 100644 --- a/src/themes/OLH/templates/journal/article.html +++ b/src/themes/OLH/templates/journal/article.html @@ -233,26 +233,29 @@

{% trans "Publisher Notes" %}

{% if article.is_published or proofing %} {% if not request.journal.disable_metrics_display %}
-
-
+
+

{{ article.metrics.views }} {% trans "Views" %}

-
-

- {{ article.metrics.downloads }} - {% trans "Downloads" %} -

-
+ + {% if galleys %} +
+

+ {{ article.metrics.downloads }} + {% trans "Downloads" %} +

+
+ {% endif %} {% if article.citation_count and not journal_settings.article.suppress_citations_metric %} -
-

- {{ article.citation_count }} - {% trans "Citations" %} -

-
+
+

+ {{ article.citation_count }} + {% trans "Citations" %} +

+
{% endif %}
diff --git a/src/themes/clean/templates/journal/article.html b/src/themes/clean/templates/journal/article.html index cd369b1e2..b1d46c25c 100644 --- a/src/themes/clean/templates/journal/article.html +++ b/src/themes/clean/templates/journal/article.html @@ -288,7 +288,9 @@

{% trans "Open Peer Reviews" %}

{% trans "Metrics" %}

  • {% trans "Views" %}: {{ article.metrics.views }}
  • -
  • {% trans "Downloads" %}: {{ article.metrics.downloads }}
  • + {% if galleys %} +
  • {% trans "Downloads" %}: {{ article.metrics.downloads }}
  • + {% endif %} {% if article.metrics.alm.twitter %}
  • {% trans "Twitter" %}: {{ article.metrics.alm.twitter }}
  • {% endif %} {% if article.metrics.alm.wikipedia %} diff --git a/src/themes/material/templates/journal/article.html b/src/themes/material/templates/journal/article.html index 3283b7f9d..543fca086 100644 --- a/src/themes/material/templates/journal/article.html +++ b/src/themes/material/templates/journal/article.html @@ -162,12 +162,14 @@

    {% trans "Views" %}

-
-
- {{ article.metrics.downloads }} -
-

{% trans "Downloads" %}

-
+ {% if galleys %} +
+
+ {{ article.metrics.downloads }} +
+

{% trans "Downloads" %}

+
+ {% endif %} {% if article.metrics.alm.twitter %}