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

Fix a bug on the article page with a misleading downloads metric #4599

Merged
merged 1 commit into from
Feb 4, 2025
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
fix #4299 Hide downloads if no downloadable galleys
  • Loading branch information
joemull committed Jan 29, 2025
commit c71be06b0107431fc8f8784a35f8601a3ce7b5d7
31 changes: 17 additions & 14 deletions src/themes/OLH/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,26 +233,29 @@ <h2>{% trans "Publisher Notes" %}</h2>
{% if article.is_published or proofing %}
{% if not request.journal.disable_metrics_display %}
<div class="top">
<div class="row">
<div class="large-{% if article.citation_count and not journal_settings.article.suppress_citations_metric %}4{% else %}6{% endif %} columns">
<div class="flex">
<div class="columns">
<p class="number">
{{ article.metrics.views }}
<span>{% trans "Views" %}</span>
</p>
</div>
<div class="large-{% if article.citation_count and not journal_settings.article.suppress_citations_metric %}4{% else %}6{% endif %} columns">
<p class="number">
{{ article.metrics.downloads }}
<span>{% trans "Downloads" %}</span>
</p>
</div>

{% if galleys %}
<div class="columns">
<p class="number">
{{ article.metrics.downloads }}
<span>{% trans "Downloads" %}</span>
</p>
</div>
{% endif %}
{% if article.citation_count and not journal_settings.article.suppress_citations_metric %}
<div class="large-4 columns">
<p class="number">
{{ article.citation_count }}
<span>{% trans "Citations" %}</span>
</p>
</div>
<div class="columns">
<p class="number">
{{ article.citation_count }}
<span>{% trans "Citations" %}</span>
</p>
</div>
{% endif %}
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/themes/clean/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ <h2>{% trans "Open Peer Reviews" %}</h2>
<h2>{% trans "Metrics" %}</h2>
<ul>
<li>{% trans "Views" %}: {{ article.metrics.views }}</li>
<li>{% trans "Downloads" %}: {{ article.metrics.downloads }}</li>
{% if galleys %}
<li>{% trans "Downloads" %}: {{ article.metrics.downloads }}</li>
{% endif %}
{% if article.metrics.alm.twitter %}
<li>{% trans "Twitter" %}: {{ article.metrics.alm.twitter }}</li>{% endif %}
{% if article.metrics.alm.wikipedia %}
Expand Down
14 changes: 8 additions & 6 deletions src/themes/material/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ <h5>
</h5>
<p><i class="fa fa-eye"></i>{% trans "Views" %}</p>
</div>
<div class="alm">
<h5>
{{ article.metrics.downloads }}
</h5>
<p><i class="fa fa-download"></i>{% trans "Downloads" %}</p>
</div>
{% if galleys %}
<div class="alm">
<h5>
{{ article.metrics.downloads }}
</h5>
<p><i class="fa fa-download"></i>{% trans "Downloads" %}</p>
</div>
{% endif %}
{% if article.metrics.alm.twitter %}
<div class="alm">
<h5>
Expand Down