diff --git a/invenio_app_rdm/config.py b/invenio_app_rdm/config.py index dd6dae132..f5a9f099f 100644 --- a/invenio_app_rdm/config.py +++ b/invenio_app_rdm/config.py @@ -994,6 +994,25 @@ def github_link_render(record): APP_RDM_ADMIN_EMAIL_RECIPIENT = "info@inveniosoftware.org" """Admin e-mail""" +APP_RDM_IDENTIFIER_SCHEMES_UI = { + "orcid": { + "url_prefix": "http://orcid.org/", + "icon": "images/orcid.svg", + "label": "ORCID", + }, + "ror": { + "url_prefix": "https://ror.org/", + "icon": "images/ror-icon.svg", + "label": "ROR", + }, + "gnd": { + "url_prefix": "http://d-nb.info/gnd/", + "icon": "images/gnd-icon.svg", + "label": "GND", + }, +} +"""Identifier Schemes UI config""" + # Invenio-Communities # =================== diff --git a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html index 6930a5025..45c034cac 100644 --- a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html +++ b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html @@ -11,32 +11,33 @@ {% macro creatibutor_icon(creatibutor) %} {% set identifier_found = namespace(value=False) %} - {% for scheme, identifier in creatibutor.person_or_org.identifiers|groupby("scheme") %} - {%- if scheme == "orcid" %} - {% set identifier_found.value = True %} - - ORCID icon - - {%- elif scheme == "ror" %} - {% set identifier_found.value = True %} - - ROR icon - - {%- elif scheme == "gnd" %} - {% set identifier_found.value = True %} - - GND icon - - {%- endif %} - {% endfor %} + {% if config.APP_RDM_IDENTIFIER_SCHEMES_UI %} + {% for scheme, details in config.APP_RDM_IDENTIFIER_SCHEMES_UI.items() %} + {% for identifier in creatibutor.person_or_org.identifiers|selectattr("scheme", "equalto", scheme) %} + {% set identifier_found.value = True %} + + {{ details.label }} icon + + {% endfor %} + {% endfor %} + {% endif %} - {# if no identifiers: distinguish btw people and organizations #} - {%- if not identifier_found.value and creatibutor.person_or_org.type == 'organizational'%} - - {%- endif %} + {# Fallback for missing identifiers #} + {% if not identifier_found.value %} + {% if creatibutor.person_or_org.type == 'organizational' %} + + {% else %} + + {% endif %} + {% endif %} {% endmacro %} + {% macro show_creatibutors(creatibutors, show_affiliations=False, type="creators", show_role=False) %} {% for creatibutor in creatibutors %}
  • @@ -81,22 +82,32 @@
    {% endmacro %} diff --git a/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html b/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html index 74fe9a725..6ed2c008b 100644 --- a/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html +++ b/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html @@ -23,14 +23,14 @@

    {{ current_u {% if active_dashboard_menu_item == "uploads" %} - + {{ _('New upload') }} {% endif %} {% if active_dashboard_menu_item == "communities" %} - + {{ _('New community') }}