Skip to content

Commit

Permalink
records/macros/detail.html: Allow funding entry with award number only (
Browse files Browse the repository at this point in the history
#2912)

* records/macros/detail.html: Allow funding entry with award number only

* records/macros/detail.html: Simplify _show_funding_item macro

* Update detail.html: different styles for funder, number and title
  • Loading branch information
karkraeg authored Jan 11, 2025
1 parent af193c7 commit 50ec8eb
Showing 1 changed file with 25 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,40 +96,37 @@ <h2>{{ add_description.type.title_l10n }} <span


{% macro _show_funding_item(item, index) %}
<dt class="ui tiny header">{{ item.funder.name if item.funder }}</dt>
{%- if item.award -%}
{%- if item.award.title_l10n -%}
<dt class="ui tiny header">
<span class="mr-5">
{% if item.award.acronym %}
{{ item.award.acronym }} –
{% endif %}

{{ item.award.title_l10n }}
</span>
<dt class="ui tiny header">
<span class="mr-0 text-muted">
{% if item.award.acronym %}
{{ item.award.acronym }} –
{% endif %}

{%- if item.award.title_l10n -%}
{{ item.award.title_l10n }}
{%- endif -%}
</span>

{%- if item.award.number -%}
<span class="ui mini basic label ml-0 mr-5" id="number-label-{{ index }}">
{{ item.award.number }}
</span>
{%- endif -%}
{%- if item.award.number -%}
<span class="ui mini basic label {% if not item.award.title_l10n %}ml-0{% endif %}" id="number-label-{{ index }}">
{{ item.award.number }}
</span>
{%- endif -%}

{%- if item.award.identifiers -%}
{% for identifier in item.award.identifiers if 'url' == identifier.scheme %}
<a href="{{ identifier.identifier }}" target="_blank"
rel="noopener noreferrer" aria-label="{{ _('Open external link') }}">
<i class="external alternate icon"></i>
</a>
{%- endfor -%}
{%- endif -%}
</dt>
{%- if item.award.identifiers -%}
{% for identifier in item.award.identifiers if 'url' == identifier.scheme %}
<a href="{{ identifier.identifier }}" target="_blank"
rel="noopener noreferrer" aria-label="{{ _('Open external link') }}">
<i class="external alternate icon"></i>
</a>
{%- endfor -%}
{%- endif -%}
<dd class="text-muted">{{ item.funder.name if item.funder }}</dd>
{%- else -%}
<dt class="ui tiny header">{{ item.funder.name if item.funder }}</dt>
{%- endif -%}
</dt>
{%- endif -%}
{% endmacro %}


{% macro show_references(references) %}
<ul class="ui bulleted list details-list">
{% for reference in references %}
Expand Down

0 comments on commit 50ec8eb

Please sign in to comment.