diff --git a/front/src/components/library/TrackBase.vue b/front/src/components/library/TrackBase.vue index da2d80d62..82da05a0a 100644 --- a/front/src/components/library/TrackBase.vue +++ b/front/src/components/library/TrackBase.vue @@ -64,29 +64,6 @@ const attributedToUrl = computed(() => router.resolve({ } })?.href) -const escapeHtml = (unsafe: string) => document.createTextNode(unsafe).textContent ?? '' -const subtitle = computed(() => { - if (track.value?.attributed_to) { - return t( - 'Uploaded by %{ uploader } on ', - { - uploaderUrl: attributedToUrl.value, - uploader: escapeHtml(`@${track.value.attributed_to.full_username}`), - date: escapeHtml(track.value.creation_date), - prettyDate: escapeHtml(momentFormat(new Date(track.value.creation_date), 'LL')) - } - ) - } - - return t( - 'Uploaded on ', - { - date: escapeHtml(track.value?.creation_date ?? ''), - prettyDate: escapeHtml(momentFormat(new Date(track.value?.creation_date ?? '1970-01-01'), 'LL')) - } - ) -}) - const { t } = useI18n() const labels = computed(() => ({ title: t('components.library.TrackBase.title'), @@ -144,10 +121,36 @@ const remove = async () => {

{{ track.title }} - + + + + + {{ track.attributed_to.full_username }} + + + + + +

diff --git a/front/src/locales/en_US.json b/front/src/locales/en_US.json index 3bf99d122..64e393429 100644 --- a/front/src/locales/en_US.json +++ b/front/src/locales/en_US.json @@ -1882,6 +1882,10 @@ }, "TrackBase": { "title": "Track", + "subtitle": { + "with-uploader": "Uploaded by {0} on {1}", + "without-uploader": "Uploaded on {0}" + }, "button": { "download": "Download", "more": "More…",