Skip to content

Commit

Permalink
sidebar: display 'Sizes' properly [+]
Browse files Browse the repository at this point in the history
- simplify formats as well
  • Loading branch information
fenekku committed Aug 23, 2024
1 parent 2475700 commit 91fafbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
it under the terms of the MIT License; see LICENSE file for more details.
#}

{%- from "invenio_app_rdm/records/macros/detail.html" import list_formats, list_languages,
list_string_values, show_dates, show_detail, show_detail_conference %}
{%- from "invenio_app_rdm/records/macros/detail.html" import
list_languages, show_dates, show_detail, show_detail_conference %}

{%- set id_doi = record.pids.get('doi', {}).get('identifier') %}

Expand All @@ -29,8 +29,8 @@ <h2 class="ui medium top attached header mt-0">{{ _('Details')}}</h2>
{{ show_detail(_('Awarding university'), record.ui.publishing_information.thesis) if record.ui.get('publishing_information', {}).get('thesis', {}) }}
{{ show_detail(_('Conference'), show_detail_conference(record.ui.conference)) if record.ui.conference }}
{{ show_detail(_('Languages'), list_languages(record.ui.languages)) if record.ui.languages }}
{{ show_detail(_('Formats'), list_formats(metadata.formats)) if metadata.formats }}
{{ show_detail(_('Sizes'), list_string_values(metadata.sizes)) if metadata.sizes }}
{{ show_detail(_('Formats'), ", ".join(metadata.formats)) if metadata.formats }}
{{ show_detail(_('Sizes'), ", ".join(metadata.sizes)) if metadata.sizes }}
</dl>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{#
Copyright (C) 2020-2024 CERN.
Copyright (C) 2024 Northwestern University.

Invenio RDM Records is free software; you can redistribute it and/or modify
it under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -11,6 +12,7 @@
<dd>{{ value }}</dd>
{%- endmacro %}


{% macro show_title_detail(title, language, value) %}
<dt class="ui tiny header">
{{ title }}
Expand All @@ -23,6 +25,7 @@
</dd>
{%- endmacro %}


{% macro show_sanitized_detail(title, value) %}
<dt class="ui tiny header">{{ title }}</dt>
<dd>
Expand All @@ -39,14 +42,6 @@
{% else %}
{{ value }}{{ ", " if not loop.last }}
{% endif %}

{% endfor %}
{% endmacro %}


{% macro list_formats(formats) %}
{% for format in formats %}
{{ format }}{{ ", " if not loop.last }}
{% endfor %}
{% endmacro %}

Expand Down Expand Up @@ -99,6 +94,7 @@ <h2>{{ add_description.type.title_l10n }} <span
{% endfor %}
{% endmacro %}


{% macro _show_funding_item(item, index) %}
{%- if item.award -%}
{%- if item.award.title_l10n -%}
Expand Down Expand Up @@ -224,6 +220,7 @@ <h2>{{ add_description.type.title_l10n }} <span
{% endif %}
{% endmacro %}


{% macro list_float_values(field, values) %}
{% for value in values %}
{% set search_url = field | custom_fields_search(value) %}
Expand Down Expand Up @@ -283,6 +280,7 @@ <h2>{{ add_description.type.title_l10n }} <span
{% endfor %}
{% endmacro %}


{% macro show_detail_conference(conference) %}
<dd>
{%- if conference.url %}
Expand Down

0 comments on commit 91fafbe

Please sign in to comment.