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

Make display of funding info clearer on article page #4464

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions src/journal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ def serve_journal_cover(request):

@has_journal
def funder_articles(request, funder_id):
# NOTE: This view is not usable currently because
# it is visually indistinguishable from the main Article search page.
# There is a filter applied to the queryset by the funder,
# but that is not represented in the filters, and the main heading
# just says "Articles".
""" Renders the list of articles in the journal.

:param request: the request associated with this call
Expand Down
23 changes: 23 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,23 @@
{% 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>
{% 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