From 9d226725be0fbe6ce61d5bbc50ec069bb1451427 Mon Sep 17 00:00:00 2001 From: Panna Liptak Date: Wed, 9 Sep 2026 16:11:04 +0200 Subject: [PATCH 1/2] feat(records,search): display subtitle below title --- .../CDSRecordsResultsListItemTitle.js | 40 +++++++++++++++++++ .../overridableRegistry/mapping.js | 4 ++ assets/less/cds-rdm/globals/site.overrides | 8 ++++ .../semantic-ui/cds_rdm/records/detail.html | 23 +++++++++++ 4 files changed, 75 insertions(+) create mode 100644 assets/js/components/search/overrides/CDSRecordsResultsListItemTitle.js diff --git a/assets/js/components/search/overrides/CDSRecordsResultsListItemTitle.js b/assets/js/components/search/overrides/CDSRecordsResultsListItemTitle.js new file mode 100644 index 00000000..88c4d745 --- /dev/null +++ b/assets/js/components/search/overrides/CDSRecordsResultsListItemTitle.js @@ -0,0 +1,40 @@ +// This file is part of CDS RDM +// Copyright (C) 2026 CERN. +// +// CDS RDM is free software; you can redistribute it and/or modify it +// under the terms of the GPL-2.0 License; see LICENSE file for more details. + +import _get from "lodash/get"; +import _truncate from "lodash/truncate"; +import PropTypes from "prop-types"; +import React from "react"; +import { Item } from "semantic-ui-react"; + +export const CDSRecordsResultsListItemTitle = ({ + result, + titleTruncated, + viewLink, +}) => { + const subtitle = _get(result, "ui.additional_titles", []).find( + (additionalTitle) => additionalTitle.type?.id === "subtitle" + )?.title; + + return ( + <> + + {titleTruncated} + + {subtitle && ( + + {_truncate(subtitle, { length: 100 })} + + )} + + ); +}; + +CDSRecordsResultsListItemTitle.propTypes = { + result: PropTypes.object.isRequired, + titleTruncated: PropTypes.string.isRequired, + viewLink: PropTypes.string.isRequired, +}; diff --git a/assets/js/invenio_app_rdm/overridableRegistry/mapping.js b/assets/js/invenio_app_rdm/overridableRegistry/mapping.js index f64fdb1b..81d20f16 100644 --- a/assets/js/invenio_app_rdm/overridableRegistry/mapping.js +++ b/assets/js/invenio_app_rdm/overridableRegistry/mapping.js @@ -16,6 +16,7 @@ import { CDSRecordsResultsListItemDescription, CDSRecordsResultsListItemLabelsAfter, } from "../../components/search/overrides/CDSRecordsResultsListItemDescription"; +import { CDSRecordsResultsListItemTitle } from "../../components/search/overrides/CDSRecordsResultsListItemTitle"; import { CDSAffiliationsSuggestions } from "../../components/deposit/overrides/CDSAffiliationsSuggestions"; import { CLCSync } from "../../components/record_details/clc_sync"; import { CommitteeApprovalManageSection } from "../../components/record_details/CommitteeApproval"; @@ -58,6 +59,9 @@ export const overriddenComponents = { CDSRecordsResultsListItemLabelsAfter, "InvenioCommunities.DetailsSearch.RecordsResultsListItem.labels.after": CDSRecordsResultsListItemLabelsAfter, + "InvenioAppRdm.Search.RecordsResultsListItem.title": CDSRecordsResultsListItemTitle, + "InvenioCommunities.DetailsSearch.RecordsResultsListItem.title": + CDSRecordsResultsListItemTitle, "InvenioAppRdm.Search.RecordsResultsListItem.description": CDSRecordsResultsListItemDescription, "InvenioCommunities.DetailsSearch.RecordsResultsListItem.description": diff --git a/assets/less/cds-rdm/globals/site.overrides b/assets/less/cds-rdm/globals/site.overrides index 808e4d2f..ac24d5df 100644 --- a/assets/less/cds-rdm/globals/site.overrides +++ b/assets/less/cds-rdm/globals/site.overrides @@ -147,3 +147,11 @@ max-width: 100%; } +#record-subtitle, +.record-subtitle { + color: @mutedTextColor; + font-weight: normal; + margin-top: -0.5em; + font-size: 1rem; +} + diff --git a/site/cds_rdm/templates/semantic-ui/cds_rdm/records/detail.html b/site/cds_rdm/templates/semantic-ui/cds_rdm/records/detail.html index 8f664f25..312d42cc 100644 --- a/site/cds_rdm/templates/semantic-ui/cds_rdm/records/detail.html +++ b/site/cds_rdm/templates/semantic-ui/cds_rdm/records/detail.html @@ -38,6 +38,29 @@ {%- endblock record_header -%} +{%- set subtitle = namespace(value=None) %} +{%- for additional_title in record.ui.additional_titles %} + {%- if additional_title.type.id == "subtitle" %} + {%- set subtitle.value = additional_title.title %} + {%- endif %} +{%- endfor %} + +{%- block record_title -%} +
+

{{ metadata.title }}

+ + {% if subtitle.value %} +

{{ subtitle.value }}

+ {% endif %} + + {% if record.ui.creators or record.ui.contributors %} +
+ {%- include "invenio_app_rdm/records/details/creatibutors.html" %} +
+ {% endif %} +
+{%- endblock record_title -%} + {%- block record_content -%} {{super()}} {% if clc_sync_entry and clc_sync_entry.clc_url %} From 3d06af04a8dd5229a8ea6e0cac9800d283392c16 Mon Sep 17 00:00:00 2001 From: Panna Liptak Date: Wed, 16 Sep 2026 10:52:42 +0200 Subject: [PATCH 2/2] upgrade invenio-app-rdm --- pyproject.toml | 2 +- uv.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c3246803..ca00e11c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ authors = [ license = "GPL-2.0" requires-python = ">=3.9" dependencies = [ - "invenio-app-rdm[opensearch2]>=v15.0.0b3.dev1", + "invenio-app-rdm[opensearch2]>=v15.0.0b4.dev0 ", "invenio-cern-sync", "invenio-preservation-sync==0.5.0", "invenio-vcs>=0.0.1", diff --git a/uv.lock b/uv.lock index 2903d2a5..c29ebbea 100644 --- a/uv.lock +++ b/uv.lock @@ -1010,7 +1010,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "cds-rdm", editable = "site" }, - { name = "invenio-app-rdm", extras = ["opensearch2"], specifier = ">=15.0.0b3.dev1" }, + { name = "invenio-app-rdm", extras = ["opensearch2"], specifier = ">=15.0.0b4.dev0" }, { name = "invenio-cern-sync", git = "https://github.com/CERNDocumentServer/invenio-cern-sync?rev=v0.8.0" }, { name = "invenio-preservation-sync", specifier = "==0.5.0" }, { name = "invenio-vcs", specifier = ">=0.0.1" }, @@ -3543,7 +3543,7 @@ wheels = [ [[package]] name = "invenio-app-rdm" -version = "15.0.0b3.dev1" +version = "15.0.0b4.dev0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cairosvg", version = "2.8.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, @@ -3585,9 +3585,9 @@ dependencies = [ { name = "invenio-theme" }, { name = "invenio-userprofiles" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/d9/34/f49cfb8f0e2a228387d2cc03857af29b06774cd2a6677e8a4029f8f773df/invenio_app_rdm-15.0.0b3.dev1.tar.gz", hash = "sha256:e053f6db6328c03d0252303ece71a8be0ebbe5a1758cd40b647fee71ed2b890c", size = 707850, upload-time = "2026-08-31T10:08:37.509Z" } +sdist = { url = "https://files.pythonhosted.org/packages/26/0f/65cfd23869fc50638970b4500fc9605460abfe90356323044825b50e2569/invenio_app_rdm-15.0.0b4.dev0.tar.gz", hash = "sha256:3635e5384fa43c16938bcb5ff44363f0f978db9fffa29b5b23a95afe539d04b7", size = 707861, upload-time = "2026-09-15T15:18:17.548Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/78/30/10e046b0d4b688a8c5e4c436791b606e013c812b8268bc4566b8f5618c1b/invenio_app_rdm-15.0.0b3.dev1-py3-none-any.whl", hash = "sha256:68fbb4c14493e1bb0120498c17ec3ab02de87d31f551f1a0b49400dbed1028c7", size = 1181028, upload-time = "2026-08-31T10:08:35.844Z" }, + { url = "https://files.pythonhosted.org/packages/99/a8/83cfdd96873ebe0c99a30dd77b06e459563ee1e53e7b897538f6c7ccf814/invenio_app_rdm-15.0.0b4.dev0-py3-none-any.whl", hash = "sha256:78c30c3d7e971a7d1ad7028df16c3da32c5439c9d0469dd26e523a01b4615e26", size = 1181077, upload-time = "2026-09-15T15:18:16.109Z" }, ] [package.optional-dependencies]