Bug description
- The displayed title is not always the first of the array.
- The title in another language is not displayed.
Current behavior
A document title is title[], where each entry has mainTitle[] and
subtitle[], each item being {value, language}.
Both UIs display a single title, filtered by the UI language:
- Public UI:
title_format (sonar/modules/documents/views.py:105) takes
title[0] and returns the mainTitle/subtitle value matching the UI
language, falling back to the first item.
- Pro/admin UI (sonar-ui):
document/detail/detail.component.html renders
title[0].mainTitle | languageValue and title[0].subtitle | languageValue
(same single-language behavior); the brief view
(document.component.html) does the same.
So titles in other languages are never shown, and the chosen value depends on
the UI language rather than the array order.
Scope
Fix the display only — keep the current data structure. (The deeper
structure simplification, moving language to the first level, is tracked
separately and is out of scope here.)
Expected behavior
Per the mockup (mockup.pdf):
- Primary title: the first entry of
title[0].mainTitle (array order,
independent of the UI language). Append, if present, the title[0].subtitle
whose language matches that main title's language.
- Other-language title(s): below the primary title, display the remaining
mainTitle entries (other languages), each with its matching-language
subtitle if present.
This applies to both UIs:
- Public UI: update
title_format.
- Pro/admin UI (sonar-ui): update the detail view title rendering (and the
brief view as relevant).
Acceptance criteria
Server: test (sonar.test.rero.ch) — v1.6.0
Bug description
Current behavior
A document title is
title[], where each entry hasmainTitle[]andsubtitle[], each item being{value, language}.Both UIs display a single title, filtered by the UI language:
title_format(sonar/modules/documents/views.py:105) takestitle[0]and returns themainTitle/subtitlevalue matching the UIlanguage, falling back to the first item.
document/detail/detail.component.htmlrenderstitle[0].mainTitle | languageValueandtitle[0].subtitle | languageValue(same single-language behavior); the brief view
(
document.component.html) does the same.So titles in other languages are never shown, and the chosen value depends on
the UI language rather than the array order.
Scope
Fix the display only — keep the current data structure. (The deeper
structure simplification, moving
languageto the first level, is trackedseparately and is out of scope here.)
Expected behavior
Per the mockup (mockup.pdf):
title[0].mainTitle(array order,independent of the UI language). Append, if present, the
title[0].subtitlewhose
languagematches that main title'slanguage.mainTitleentries (other languages), each with its matching-languagesubtitle if present.
This applies to both UIs:
title_format.brief view as relevant).
Acceptance criteria
mainTitle[0](first array element),regardless of the UI language
that title (when it exists)
their matching subtitles
Server: test (sonar.test.rero.ch) —
v1.6.0