From 2962659e445bbddfc2c1e4d8ad7c1e9176330df4 Mon Sep 17 00:00:00 2001 From: Miina Saroma Date: Fri, 22 Nov 2024 20:17:16 +0200 Subject: [PATCH 1/8] Change css, rm after gradient --- frontend/src/components/DetailView/DetailBrowser.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/DetailView/DetailBrowser.tsx b/frontend/src/components/DetailView/DetailBrowser.tsx index f8515195..7d1ba32b 100644 --- a/frontend/src/components/DetailView/DetailBrowser.tsx +++ b/frontend/src/components/DetailView/DetailBrowser.tsx @@ -15,22 +15,14 @@ export const DetailBrowser = () => { const nextIndex = currentIndex + 1 const previousIndex = currentIndex - 1 const style = { - width: '18em', + width: '50em', marginLeft: '0em', overflow: 'hidden', - whiteSpace: 'nowrap', + whiteSpace: 'pre', textOverflow: 'ellipsis', position: 'relative', textAlign: 'left', fontSize: '2.3em', - '&::after': { - content: '""', - position: 'absolute', - right: 0, - width: '20%', - height: '100%', - background: 'linear-gradient(to right, transparent, white 50%)', - }, } const getText = () => { if (mode.read) { From 4490fc51026c3fce2c12c12214ac335febc482a7 Mon Sep 17 00:00:00 2001 From: Miina Saroma Date: Fri, 22 Nov 2024 20:18:33 +0200 Subject: [PATCH 2/8] New headers for loc, species --- frontend/src/components/pages.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index 14e663b7..4fdc51a2 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -39,7 +39,9 @@ export const localityPage = ( detailView={} viewName="locality" idFieldName="lid" - createTitle={(loc: LocalityDetailsType) => `${loc.loc_name}`} + createTitle={(loc: LocalityDetailsType) => + `${loc.lid} ${loc.loc_name}, ${loc.country} \n${loc.dms_lat}, ${loc.dms_long}\n${loc.max_age} Ma (${loc.bfa_max}) – ${loc.min_age} Ma (${loc.bfa_min})` + } getEditRights={(user: UserState, id: string | number) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights if (user.role === Role.EditRestricted && user.localities.includes(id as number)) return limitedRights @@ -69,7 +71,13 @@ export const speciesPage = ( detailView={} viewName="species" idFieldName="species_id" - createTitle={(species: SpeciesDetailsType) => `${species.genus_name + ' ' + species.species_name}`} + createTitle={(species: SpeciesDetailsType) => + `${species.species_id} ${species.genus_name + ' ' + species.species_name}` + + `\n${species.unique_identifier}` + + `\nOrder ${species.order_name}` + + `\nFamily ${species.family_name}` + + `\nSubfamily or Tribe ${species.subfamily_name}` + } getEditRights={(user: UserState) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights if (user.role === Role.EditRestricted) return limitedRights From 8b7d15e77d0ea3a4a2b37867d48ac74d7076b95b Mon Sep 17 00:00:00 2001 From: Miina Saroma Date: Wed, 27 Nov 2024 13:59:52 +0200 Subject: [PATCH 3/8] Headers for References --- frontend/src/components/pages.tsx | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index 4fdc51a2..6910f398 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -86,13 +86,41 @@ export const speciesPage = ( /> ) +// Instead of "Cenozoic Geochronology", use +// 30 +// Berggren et al. (1985). Cenozoic Geochronology. Geological Society of America Bulletin 96: 1407-1418. + +// uh miten saan noi et al. >:/ <-- updateTab / makenamelist + +// http://localhost:5173/reference/10031 ?? miksei tee mitään?? AHAA null, no vittu +// 10031 nyt about toimii + +//tää on nyt TÄYSIN varastettu UpdateTabista, paitsi lisätty undefined + +const makeNameList = (names: Array) => { + if (names.length === 3) { + return `${names[0]}, ${names[1]} & ${names[2]}` + } else if (names.length >= 4) { + return `${names[0]} et al.` + } else if (names.length === 2) { + return `${names[0]} & ${names[1]}` + } + return names[0] ?? '' +} + export const referencePage = ( } detailView={} viewName="reference" idFieldName="rid" - createTitle={(ref: ReferenceDetailsType) => `${ref.title_primary}`} + createTitle={(ref: ReferenceDetailsType) => + `${ref.rid}` + + `\n${makeNameList(ref.ref_authors.map(author => author.author_surname))} (${ref.date_primary ? ref.date_primary : 'date missing'}).` + + `\n${ref.title_primary ? ref.title_primary + '.' : ''}` + + `\n${ref.ref_journal && ref.ref_type_id == 1 ? ref.ref_journal.journal_title + '. ' : ''}${ref.title_secondary ? ref.title_secondary + '. ' : ''}${ref.gen_notes ? ref.gen_notes : ''}` + + `\n${ref.volume ? ref.volume + ' ' : ''} ${ref.start_page || ref.end_page ? 'pp: ' : ''}${ref.start_page ? ref.start_page + '-' : ''}${ref.end_page ? ref.end_page : ''} ${ref.publisher ? ref.publisher : ''}${ref.pub_place ? ', ' + ref.pub_place : ''}` + } getEditRights={(user: UserState) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights if (user.role === Role.EditRestricted) return { new: true } From 4a6053d27e94db39837a38263fb858a2e8ae5b37 Mon Sep 17 00:00:00 2001 From: Sampo Riitala <57003465+realtalin@users.noreply.github.com> Date: Sun, 1 Dec 2024 02:03:10 +0200 Subject: [PATCH 4/8] add new headers for time units and time bounds --- frontend/src/components/pages.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index 6910f398..6b0d4cb6 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -135,7 +135,12 @@ export const timeUnitPage = ( detailView={} viewName="time-unit" idFieldName="tu_name" - createTitle={(tu: TimeUnitDetailsType) => `${tu.tu_display_name}`} + createTitle={(tu: TimeUnitDetailsType) => + `(${tu.tu_name}) ${tu.tu_display_name} - ${tu.tu_comment}` + + `\n${tu.up_bnd} Ma – ${tu.low_bnd}` + + `\n${tu.sequence}` + + `\n${tu.rank}` + } getEditRights={(user: UserState) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights return noRights @@ -150,7 +155,7 @@ export const timeBoundPage = ( detailView={} viewName="time-bound" idFieldName="bid" - createTitle={(tb: TimeBoundDetailsType) => `${tb.b_name}`} + createTitle={(tb: TimeBoundDetailsType) => `${tb.bid} ${tb.b_name}`} getEditRights={(user: UserState) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights return noRights From e3e0147c388afcb3ff05ad486ec7ebc7e8475a9a Mon Sep 17 00:00:00 2001 From: Sampo Riitala <57003465+realtalin@users.noreply.github.com> Date: Sun, 1 Dec 2024 03:39:48 +0200 Subject: [PATCH 5/8] move additional information to subtitle --- .../components/DetailView/DetailBrowser.tsx | 20 +++++++++--- frontend/src/components/Page.tsx | 7 +++++ frontend/src/components/pages.tsx | 31 ++++++++++--------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/DetailView/DetailBrowser.tsx b/frontend/src/components/DetailView/DetailBrowser.tsx index 7d1ba32b..48e50bab 100644 --- a/frontend/src/components/DetailView/DetailBrowser.tsx +++ b/frontend/src/components/DetailView/DetailBrowser.tsx @@ -1,4 +1,4 @@ -import { Box, Button } from '@mui/material' +import { Box, Button, Stack } from '@mui/material' import ArrowBackIcon from '@mui/icons-material/ArrowBack' import ArrowForwardIcon from '@mui/icons-material/ArrowForward' import { useDetailContext } from './Context/DetailContext' @@ -9,7 +9,7 @@ export const DetailBrowser = () => { const { data, mode } = useDetailContext() const navigate = useNavigate() const location = useLocation() - const { idList, idFieldName, viewName, createTitle } = usePageContext() + const { idList, idFieldName, viewName, createTitle, createSubtitle } = usePageContext() const idListExists = idList?.length > 0 const currentIndex = idList.indexOf((data as { [key: string]: string })[idFieldName]) const nextIndex = currentIndex + 1 @@ -24,7 +24,7 @@ export const DetailBrowser = () => { textAlign: 'left', fontSize: '2.3em', } - const getText = () => { + const getTitleText = () => { if (mode.read) { return `${createTitle(data)}` } else if (mode.new) { @@ -32,6 +32,15 @@ export const DetailBrowser = () => { } return `${createTitle(data)}` } + + const getSubtitleText = () => { + if (mode.read) { + return `${createSubtitle(data)}` + } else if (mode.new) { + return '' + } + return `${createSubtitle(data)}` + } const search = location.search return ( @@ -44,7 +53,10 @@ export const DetailBrowser = () => { gap: '1em', }} > - {getText()} + + {getTitleText()} + {getSubtitleText()} + {idListExists && mode.read && (
{previousIndex >= 0 && ( diff --git a/frontend/src/components/Page.tsx b/frontend/src/components/Page.tsx index 2b01df2a..70e68110 100644 --- a/frontend/src/components/Page.tsx +++ b/frontend/src/components/Page.tsx @@ -15,6 +15,7 @@ export type PageContextType = { tableUrl: string setTableUrl: (newUrl: string) => void createTitle: (data: T) => string + createSubtitle: (data: T) => string editRights: EditRights } @@ -25,12 +26,14 @@ export const PageContextProvider = ({ idFieldName, viewName, createTitle, + createSubtitle, editRights, }: { children: ReactNode | ReactNode[] idFieldName: string viewName: string createTitle: (data: T) => string + createSubtitle: (data: T) => string editRights: EditRights }) => { const [idList, setIdList] = useState([]) @@ -47,6 +50,7 @@ export const PageContextProvider = ({ tableUrl, setTableUrl: (newUrl: string) => setTableUrl(newUrl), createTitle: (data: unknown) => createTitle(data as T), + createSubtitle: (data: unknown) => createSubtitle(data as T), }} > {children} @@ -68,6 +72,7 @@ export const Page = >({ idFieldName, viewName, createTitle, + createSubtitle, allowedRoles, getEditRights, }: { @@ -76,6 +81,7 @@ export const Page = >({ idFieldName: keyof T viewName: string createTitle: (data: T) => string + createSubtitle?: (data: T) => string allowedRoles?: Role[] getEditRights: (user: UserState, id: string | number) => EditRights }) => { @@ -90,6 +96,7 @@ export const Page = >({ idFieldName={idFieldName as string} viewName={viewName} createTitle={createTitle} + createSubtitle={createSubtitle ? createSubtitle : () => ''} > {id ? detailView : tableView} diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index 6b0d4cb6..f02a01b9 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -39,8 +39,9 @@ export const localityPage = ( detailView={} viewName="locality" idFieldName="lid" - createTitle={(loc: LocalityDetailsType) => - `${loc.lid} ${loc.loc_name}, ${loc.country} \n${loc.dms_lat}, ${loc.dms_long}\n${loc.max_age} Ma (${loc.bfa_max}) – ${loc.min_age} Ma (${loc.bfa_min})` + createTitle={(loc: LocalityDetailsType) => `${loc.lid} ${loc.loc_name}, ${loc.country}`} + createSubtitle={(loc: LocalityDetailsType) => + `${loc.dms_lat}, ${loc.dms_long}\n${loc.max_age} Ma (${loc.bfa_max}) – ${loc.min_age} Ma (${loc.bfa_min})` } getEditRights={(user: UserState, id: string | number) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights @@ -56,7 +57,10 @@ export const crossSearchPage = ( detailView={} viewName="crosssearch" idFieldName="lid" - createTitle={(loc: LocalityDetailsType) => `${loc.loc_name}`} + createTitle={(loc: LocalityDetailsType) => `${loc.lid} ${loc.loc_name}, ${loc.country}`} + createSubtitle={(loc: LocalityDetailsType) => + `${loc.dms_lat}, ${loc.dms_long}` + `\n${loc.max_age} Ma (${loc.bfa_max}) – ${loc.min_age} Ma (${loc.bfa_min})` + } getEditRights={(user: UserState, id: string | number) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights if (user.role === Role.EditRestricted && user.localities.includes(id as number)) return limitedRights @@ -72,9 +76,10 @@ export const speciesPage = ( viewName="species" idFieldName="species_id" createTitle={(species: SpeciesDetailsType) => - `${species.species_id} ${species.genus_name + ' ' + species.species_name}` + - `\n${species.unique_identifier}` + - `\nOrder ${species.order_name}` + + `${species.species_id} ${species.genus_name} ${species.species_name}` + `\n${species.unique_identifier}` + } + createSubtitle={(species: SpeciesDetailsType) => + `Order ${species.order_name}` + `\nFamily ${species.family_name}` + `\nSubfamily or Tribe ${species.subfamily_name}` } @@ -114,9 +119,9 @@ export const referencePage = ( detailView={} viewName="reference" idFieldName="rid" - createTitle={(ref: ReferenceDetailsType) => - `${ref.rid}` + - `\n${makeNameList(ref.ref_authors.map(author => author.author_surname))} (${ref.date_primary ? ref.date_primary : 'date missing'}).` + + createTitle={(ref: ReferenceDetailsType) => `${ref.rid}`} + createSubtitle={(ref: ReferenceDetailsType) => + `${makeNameList(ref.ref_authors.map(author => author.author_surname))} (${ref.date_primary ? ref.date_primary : 'date missing'}).` + `\n${ref.title_primary ? ref.title_primary + '.' : ''}` + `\n${ref.ref_journal && ref.ref_type_id == 1 ? ref.ref_journal.journal_title + '. ' : ''}${ref.title_secondary ? ref.title_secondary + '. ' : ''}${ref.gen_notes ? ref.gen_notes : ''}` + `\n${ref.volume ? ref.volume + ' ' : ''} ${ref.start_page || ref.end_page ? 'pp: ' : ''}${ref.start_page ? ref.start_page + '-' : ''}${ref.end_page ? ref.end_page : ''} ${ref.publisher ? ref.publisher : ''}${ref.pub_place ? ', ' + ref.pub_place : ''}` @@ -135,11 +140,9 @@ export const timeUnitPage = ( detailView={} viewName="time-unit" idFieldName="tu_name" - createTitle={(tu: TimeUnitDetailsType) => - `(${tu.tu_name}) ${tu.tu_display_name} - ${tu.tu_comment}` + - `\n${tu.up_bnd} Ma – ${tu.low_bnd}` + - `\n${tu.sequence}` + - `\n${tu.rank}` + createTitle={(tu: TimeUnitDetailsType) => `(${tu.tu_name}) ${tu.tu_display_name} - ${tu.tu_comment}`} + createSubtitle={(tu: TimeUnitDetailsType) => + `${tu.up_bnd} Ma – ${tu.low_bnd} Ma` + `\n${tu.sequence}` + `\n${tu.rank}` } getEditRights={(user: UserState) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights From 651f4d1f135cc0687c7aab52464f6fd30769d44b Mon Sep 17 00:00:00 2001 From: Sampo Riitala <57003465+realtalin@users.noreply.github.com> Date: Sun, 1 Dec 2024 05:19:21 +0200 Subject: [PATCH 6/8] port reference subtitle creation --- frontend/src/components/pages.tsx | 107 ++++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index f02a01b9..0afdbb46 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -113,6 +113,106 @@ const makeNameList = (names: Array) => { return names[0] ?? '' } +const createReferenceSubtitle = (ref: ReferenceDetailsType) => { + const authorsSurnames = ref.ref_authors.filter(author => author.field_id === 2).map(author => author.author_surname) + const editorsSurnames = ref.ref_authors.filter(author => author.field_id === 12).map(author => author.author_surname) + const authorsPart = `${makeNameList(authorsSurnames)}` + const editorsPart = `${makeNameList(editorsSurnames)} ${editorsSurnames.length > 1 ? '(eds)' : '(ed)'}` + const datePart = `(${ref.date_primary})` + + let title = `${authorsPart} ${datePart}.` + + switch (ref.ref_type_id) { + case 1: // Journal + title += ` ${ref.title_primary}. ${ref.ref_journal.journal_title}` + if (ref.volume) { + title += ` ${ref.volume}` + } + if (ref.issue) { + title += ` (${ref.issue})` + } + if (ref.start_page || ref.end_page) { + title += `: ` + } + if (ref.start_page) { + title += `${ref.start_page}-` + } + if (ref.end_page) { + title += `${ref.end_page}` + } + if (ref.volume || ref.issue || ref.start_page || ref.end_page) { + title += `.` + } + return title + case 2: // Book + title += ` ${ref.title_primary}.` + if (ref.publisher || ref.pub_place) { + title += ` ` + } + if (ref.publisher) { + title += `${ref.publisher}` + } + if (ref.publisher && ref.pub_place) { + title += `, ` + } + if (ref.pub_place) { + title += `${ref.pub_place}` + } + if (ref.publisher || ref.pub_place) { + title += `.` + } + return title + case 3: // Book Chapter + title += ` ${ref.title_primary}. IN: ${editorsPart} ${ref.title_secondary}.` + + if (ref.start_page || ref.end_page) { + title += ` pp.` + } + if (ref.start_page) { + title += `${ref.start_page}` + } + if (ref.start_page && ref.end_page) { + title += `-` + } + if (ref.end_page) { + title += `${ref.end_page}` + } + if (ref.start_page || ref.end_page) { + title += `.` + } + if (ref.publisher || ref.pub_place) { + title += ` ` + } + if (ref.publisher) { + title += `${ref.publisher}` + } + if (ref.publisher && ref.pub_place) { + title += `, ` + } + if (ref.pub_place) { + title += `${ref.pub_place}` + } + if (ref.publisher || ref.pub_place) { + title += `.` + } + return title + default: + if (ref.title_primary) { + title += ` ${ref.title_primary}.` + } + if (ref.title_secondary) { + title += ` ${ref.title_secondary}.` + } + if (ref.title_series) { + title += ` ${ref.title_series}.` + } + if (ref.gen_notes) { + title += ` ${ref.gen_notes}.` + } + return title + } +} + export const referencePage = ( } @@ -120,12 +220,7 @@ export const referencePage = ( viewName="reference" idFieldName="rid" createTitle={(ref: ReferenceDetailsType) => `${ref.rid}`} - createSubtitle={(ref: ReferenceDetailsType) => - `${makeNameList(ref.ref_authors.map(author => author.author_surname))} (${ref.date_primary ? ref.date_primary : 'date missing'}).` + - `\n${ref.title_primary ? ref.title_primary + '.' : ''}` + - `\n${ref.ref_journal && ref.ref_type_id == 1 ? ref.ref_journal.journal_title + '. ' : ''}${ref.title_secondary ? ref.title_secondary + '. ' : ''}${ref.gen_notes ? ref.gen_notes : ''}` + - `\n${ref.volume ? ref.volume + ' ' : ''} ${ref.start_page || ref.end_page ? 'pp: ' : ''}${ref.start_page ? ref.start_page + '-' : ''}${ref.end_page ? ref.end_page : ''} ${ref.publisher ? ref.publisher : ''}${ref.pub_place ? ', ' + ref.pub_place : ''}` - } + createSubtitle={createReferenceSubtitle} getEditRights={(user: UserState) => { if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights if (user.role === Role.EditRestricted) return { new: true } From d97339774f83e23cb1f6613cde8b3b854f29c134 Mon Sep 17 00:00:00 2001 From: Sampo Riitala <57003465+realtalin@users.noreply.github.com> Date: Sun, 1 Dec 2024 05:35:44 +0200 Subject: [PATCH 7/8] wrap long subtitles --- .../src/components/DetailView/DetailBrowser.tsx | 2 +- frontend/src/components/pages.tsx | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/DetailView/DetailBrowser.tsx b/frontend/src/components/DetailView/DetailBrowser.tsx index 48e50bab..b79fd11e 100644 --- a/frontend/src/components/DetailView/DetailBrowser.tsx +++ b/frontend/src/components/DetailView/DetailBrowser.tsx @@ -18,7 +18,7 @@ export const DetailBrowser = () => { width: '50em', marginLeft: '0em', overflow: 'hidden', - whiteSpace: 'pre', + whiteSpace: 'pre-wrap', textOverflow: 'ellipsis', position: 'relative', textAlign: 'left', diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index 0afdbb46..aba18122 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -91,17 +91,7 @@ export const speciesPage = ( /> ) -// Instead of "Cenozoic Geochronology", use -// 30 -// Berggren et al. (1985). Cenozoic Geochronology. Geological Society of America Bulletin 96: 1407-1418. - -// uh miten saan noi et al. >:/ <-- updateTab / makenamelist - -// http://localhost:5173/reference/10031 ?? miksei tee mitään?? AHAA null, no vittu -// 10031 nyt about toimii - -//tää on nyt TÄYSIN varastettu UpdateTabista, paitsi lisätty undefined - +// from UpdateTab const makeNameList = (names: Array) => { if (names.length === 3) { return `${names[0]}, ${names[1]} & ${names[2]}` @@ -118,9 +108,8 @@ const createReferenceSubtitle = (ref: ReferenceDetailsType) => { const editorsSurnames = ref.ref_authors.filter(author => author.field_id === 12).map(author => author.author_surname) const authorsPart = `${makeNameList(authorsSurnames)}` const editorsPart = `${makeNameList(editorsSurnames)} ${editorsSurnames.length > 1 ? '(eds)' : '(ed)'}` - const datePart = `(${ref.date_primary})` - let title = `${authorsPart} ${datePart}.` + let title = `${authorsPart} ${ref.date_primary}.` switch (ref.ref_type_id) { case 1: // Journal From 640b1807f42ad109ee909cc4ba69672f508d5122 Mon Sep 17 00:00:00 2001 From: Sampo Riitala <57003465+realtalin@users.noreply.github.com> Date: Sun, 1 Dec 2024 05:40:12 +0200 Subject: [PATCH 8/8] add back accidentally removed parentheses --- frontend/src/components/pages.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/pages.tsx b/frontend/src/components/pages.tsx index aba18122..57a992dd 100644 --- a/frontend/src/components/pages.tsx +++ b/frontend/src/components/pages.tsx @@ -109,7 +109,7 @@ const createReferenceSubtitle = (ref: ReferenceDetailsType) => { const authorsPart = `${makeNameList(authorsSurnames)}` const editorsPart = `${makeNameList(editorsSurnames)} ${editorsSurnames.length > 1 ? '(eds)' : '(ed)'}` - let title = `${authorsPart} ${ref.date_primary}.` + let title = `${authorsPart} (${ref.date_primary}).` switch (ref.ref_type_id) { case 1: // Journal