diff --git a/templates/semantic-ui/invenio_app_rdm/records/details/creatibutors.html b/templates/semantic-ui/invenio_app_rdm/records/details/creatibutors.html new file mode 100644 index 0000000..f1e0e6e --- /dev/null +++ b/templates/semantic-ui/invenio_app_rdm/records/details/creatibutors.html @@ -0,0 +1,49 @@ +{# + Copyright (C) 2020 CERN. + Copyright (C) 2020 Northwestern University. + Copyright (C) 2021 TU Wien. + + 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. +#} + +{%- from "invenio_app_rdm/records/macros/creatibutors.html" import affiliations_accordion, show_creatibutors %} + +
+ {% if record.ui.creators and record.ui.creators.creators %} +
+
+
+ + {{ show_creatibutors(record.ui.creators.creators, show_affiliations=True, show_role=True) }} +
+
+ + {# Todo: get full list of all affiliations (both creators & contributors) e.g. + record.ui.affiliation and merge to one accordion #} + {% if record.ui.creators and record.ui.creators.affiliations %} + {{ affiliations_accordion('creators', record.ui.creators.affiliations)}} + {% endif %} + +
+ {% endif %} + + {% if record.ui.contributors and record.ui.contributors.contributors %} +
+
+ + {%- for group in record.ui.contributors.contributors|groupby('role.title')%} +
+
{{group.grouper}}{%- if group.list|length > 1 -%}s{%- endif -%}:
+ {{ show_creatibutors(group.list, show_affiliations=True, type="contributors") }} +
+ {%- endfor %} +
+ + {% if record.ui.contributors and record.ui.contributors.affiliations %} + {{ affiliations_accordion('contributors', record.ui.contributors.affiliations)}} + {% endif %} + +
+ {% endif %} +
diff --git a/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html b/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html new file mode 100644 index 0000000..0698e81 --- /dev/null +++ b/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html @@ -0,0 +1,102 @@ +{# + Copyright (C) 2020 CERN. + Copyright (C) 2020 Northwestern University. + Copyright (C) 2021 Graz University of Technology. + Copyright (C) 2021-2022 New York 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. +#} + +{% 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 no identifiers: distinguish btw people and organizations #} + {%- if not identifier_found.value and creatibutor.person_or_org.type == 'organizational'%} + + {%- endif %} +{% endmacro %} + + +{% macro show_creatibutors(creatibutors, show_affiliations=False, type="creators", show_role=False) %} + {% for creatibutor in creatibutors %} +
+ + + + {{- creatibutor.person_or_org.name -}} + {% if show_role and creatibutor.role %} + ({{- creatibutor.role.title -}}) + {%- endif -%} + + {%- if creatibutor.affiliations -%} + + {%- for affiliation in creatibutor.affiliations -%} + {{ affiliation[0] }}{{ ", " if not loop.last }} + {%- endfor -%} + + {%- endif -%} + + {{- creatibutor_icon(creatibutor) -}} +
+ {% endfor %} +{%- endmacro %} + + +{% macro affiliations_accordion(group, affiliations) %} +
+ +
+ +
+ +
+{% endmacro %}