Skip to content

Commit

Permalink
fix #4299 Hide downloads if no downloadable galleys
Browse files Browse the repository at this point in the history
  • Loading branch information
joemull authored and ajrbyers committed Feb 4, 2025
1 parent 3cad511 commit d9c1ea5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
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

0 comments on commit d9c1ea5

Please sign in to comment.