Skip to content

Commit

Permalink
Make display of funding metadata clearer #4461
Browse files Browse the repository at this point in the history
  • Loading branch information
joemull committed Oct 25, 2024
1 parent 73d4e63 commit 1bf11de
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 70 deletions.
30 changes: 30 additions & 0 deletions src/templates/common/elements/funder_info_for_readers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% if article.funders.all %}
<div class="callout primary">
<h2>{% trans "Funding" %}</h2>
{% trans "Name" as name_label %}
{% trans "FundRef ID" as fundref_id_label %}
{% trans "Funding ID" as funding_id_label %}
{% trans "Funding Statement" as statement_label %}
{% for funder in article.funders.all %}
<dl>
{% include "elements/layout/key_value_above.html" with key=name_label value=funder.name %}
{% if funder.fundref_id %}
{% include "elements/layout/key_value_above.html" with key=fundref_id_label value=funder.fundref_id %}
{% endif %}
{% if funder.funding_id %}
{% include "elements/layout/key_value_above.html" with key=funding_id_label value=funder.funding_id %}
{% endif %}
{% if funder.funding_statement %}
{% include "elements/layout/key_value_above.html" with key=statement_label value=funder.funding_statement|safe render_line_breaks=True %}
{% endif %}
</dl>
{% if funder.fundref_id %}
<p>
<a href="{% url "funder_articles" funder.fundref_id %}">
{% trans "Browse all articles funded by" %} {{ funder.name }}
</a>
</p>
{% endif %}
{% endfor %}
</div>
{% endif %}
26 changes: 1 addition & 25 deletions src/themes/OLH/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,31 +228,7 @@ <h2>{% trans "Publisher Notes" %}</h2>
{% endif %}
</div>
{% endif %}

{% if article.funders.all %}
<h2>{% trans "Funding" %}</h2>

{% for funder in article.funders.all %}
<p>
{% if funder.fundref_id %}
<a href="{% url "funder_articles" funder.fundref_id %}">{{ funder.name }}</a>
{% else %}
{{ funder.name }}
{% endif %}
{% if funder.funding_id %}
{% blocktranslate with id=funder.funding_id %}
({{ id }})
{% endblocktranslate %}
{% endif %}
{% if funder.funding_statement %}
<br/>
{{ funder.funding_statement|safe|linebreaksbr }}
{% endif %}
</p>
{% endfor %}

{% endif %}

{% include "elements/funder_info_for_readers.html" %}
<div class="summary">
{% if article.is_published or proofing %}
{% if not request.journal.disable_metrics_display %}
Expand Down
24 changes: 3 additions & 21 deletions src/themes/clean/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,9 @@ <h2>{% trans "Abstract" %}</h2>
</p>
</div>
{% endif %}
{% if article.funders.all %}
<strong>{% trans "Funding" %}</strong>
{% for funder in article.funders.all %}
<p>
{% if funder.fundref_id %}
<a href="{% url "funder_articles" funder.fundref_id %}">{{ funder.name }}</a>
{% else %}
{{ funder.name }}
{% endif %}
{% if funder.funding_id %}
{% blocktranslate with id=funder.funding_id %}
({{ id }})
{% endblocktranslate %}
{% endif %}
{% if funder.funding_statement %}
<br/>
{{ funder.funding_statement|safe|linebreaksbr }}
{% endif %}
</p>
{% endfor %}
{% endif %}

{% include "elements/funder_info_for_readers.html" %}

{% if article.publisher_notes.all %}
<div class="callout primary">
<h2>{% trans "Publisher Notes" %}</h2>
Expand Down
25 changes: 1 addition & 24 deletions src/themes/material/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,30 +147,7 @@ <h2>{% trans "Downloads" %}</h2>
</div>
</div>
{% endif %}

{% if article.funders.all %}
<div class="callout primary">
<h2>{% trans "Funding" %}</h2>
{% for funder in article.funders.all %}
<p>
{% if funder.fundref_id %}
<a href="{% url "funder_articles" funder.fundref_id %}">{{ funder.name }}</a>
{% else %}
{{ funder.name }}
{% endif %}
{% if funder.funding_id %}
{% blocktranslate with id=funder.funding_id %}
({{ id }})
{% endblocktranslate %}
{% endif %}
{% if funder.funding_statement %}
<br/>
{{ funder.funding_statement|safe|linebreaksbr }}
{% endif %}
</p>
{% endfor %}
</div>
{% endif %}
{% include "elements/funder_info_for_readers.html" %}
</div>
</div>
<div class="row">
Expand Down

0 comments on commit 1bf11de

Please sign in to comment.