Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Audio single result refinements (#744)

Zack Krida037f2efb768f
diff --git a/src/components/AudioDetails/VAudioDetails.vue b/src/components/AudioDetails/VAudioDetails.vue
index 7718fd06a..74b708e88 100644
--- a/src/components/AudioDetails/VAudioDetails.vue
+++ b/src/components/AudioDetails/VAudioDetails.vue
@@ -1,12 +1,23 @@
<template>
- <!--eslint-disable @intlify/vue-i18n/no-raw-text -->
<section class="audio-info">
- <h4 class="b-header mb-6">Audio information</h4>
- <div class="mb-6 audio-info__grid">
- <VAudioThumbnail :audio="audio" />
- <div class="audio-info__data">
+ <h4 class="text-base lg:text-3xl mb-6">
+ {{ $t('audio-details.information') }}
+ </h4>
+ <div class="flex flex-col md:flex-row items-start gap-6">
+ <div class="w-[75px] h-[75px] lg:w-30 lg:h-30 rounded-sm overflow-hidden">
+ <VAudioThumbnail :audio="audio" />
+ </div>
+ <div class="flex flex-col gap-4 lg:gap-6 flex-grow">
<p v-if="audio.description" class="mb-6">{{ audio.description }}</p>
- <VAudioTags :tags="audio.tags" :show-header="false" class="mb-6" />
+ <ul class="flex flex-wrap gap-2">
+ <MediaTag
+ v-for="(tag, index) in audio.tags.filter((i) => !!i)"
+ :key="index"
+ tag="li"
+ >
+ {{ tag.name }}
+ </MediaTag>
+ </ul>
<dl v-if="audio">
<div v-if="audio.audio_set">
<dt>{{ $t('audio-details.table.album') }}</dt>
@@ -41,10 +52,16 @@
{{ $t('audio-details.table.provider') }}
</dt>
<dd>
- {{ providerName }}
+ <a
+ :href="audio.foreign_landing_url"
+ target="blank"
+ rel="noopener noreferrer"
+ >
+ {{ providerName }}
+ </a>
</dd>
</div>
- <div v-if="audio.source">
+ <div v-if="audio.source && sourceName !== providerName">
<dt>
{{ $t('audio-details.table.source') }}
</dt>
@@ -52,7 +69,7 @@
{{ sourceName }}
</dd>
</div>
- <div v-if="audio.genres">
+ <div v-if="audio.genres && audio.genres.length > 0">
<dt>
{{ $t('audio-details.table.genre') }}
</dt>
@@ -87,16 +104,13 @@ export default {
</script>
<style lang="scss" scoped>
-.audio-info__grid {
- display: grid;
- grid-template-columns: 110px auto;
- grid-template-rows: repeat(auto-fit, 1fr);
- grid-gap: 1.5rem;
-}
dl {
- display: grid;
+ @apply grid gap-4;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
- grid-gap: 1.5rem;
+
+ @screen lg {
+ @apply gap-5;
+ }
}
dl div {
display: flex;
diff --git a/src/components/AudioDetails/VAudioTags.vue b/src/components/AudioDetails/VAudioTags.vue
deleted file mode 100644
index bc4074eeb..000000000
--- a/src/components/AudioDetails/VAudioTags.vue
+++ /dev/null
@@ -1,45 +0,0 @@
-<template>
- <div v-if="tags && tags.length" class="media_tags">
- <h3 v-if="showHeader" class="b-header">
- {{ header }}
- </h3>
- <div>
- <MediaTag
- v-for="(tag, index) in getValidTags()"
- :key="index"
- class="me-4 inline"
- @click="searchByTagName"
- >
- {{ tag.name }}
- </MediaTag>
- </div>
- </div>
-</template>
-
-<script>
-import { UPDATE_QUERY } from '~/constants/action-types'
-import { SEARCH } from '~/constants/store-modules'
-import { mapActions } from 'vuex'
-
-export default {
- name: 'VAudioTags',
- props: ['tags', 'header'],
- computed: {
- showHeader() {
- return this.$props.header !== ''
- },
- },
- methods: {
- ...mapActions(SEARCH, { setSearchTerm: UPDATE_QUERY }),
- isClarifaiTag(provider) {
- return provider === 'clarifai'
- },
- searchByTagName(query) {
- this.setSearchTerm({ q: query })
- },
- getValidTags() {
- return this.$props.tags.filter((tag) => !!tag.name)
- },
- },
-}
-</script>
diff --git a/src/components/AudioDetails/VRelatedAudio.vue b/src/components/AudioDetails/VRelatedAudio.vue
index 321a97bd9..e4ad72ce8 100644
--- a/src/components/AudioDetails/VRelatedAudio.vue
+++ b/src/components/AudioDetails/VRelatedAudio.vue
@@ -1,19 +1,18 @@
<template>
- <aside :aria-label="$t('photo-details.aria.related')">
- <h4 class="b-header mb-6">
+ <aside :aria-label="$t('audio-details.related-audios')">
+ <h4 class="text-base lg:text-3xl mb-6">
{{ $t('audio-details.related-audios') }}
</h4>
- <template v-if="!$fetchState.error">
+ <div v-if="!$fetchState.error" class="flex flex-col gap-8 lg:gap-12 mb-12">
<VAudioTrack
v-for="audio in audios"
:key="audio.id"
:audio="audio"
layout="row"
- size="m"
- class="mb-12"
+ :size="audioTrackSize"
/>
<LoadingIcon v-show="$fetchState.pending" />
- </template>
+ </div>
<p v-show="!!$fetchState.error">
{{ $t('media-details.related-error') }}
</p>
@@ -21,9 +20,11 @@
</template>
<script>
-import { ref } from '@nuxtjs/composition-api'
+import { computed, ref } from '@nuxtjs/composition-api'
import { AUDIO } from '~/constants/media'
+
import useRelated from '~/composables/use-related'
+import { isMinScreen } from '@/composables/use-media-query'
export default {
name: 'VRelatedAudio',
@@ -39,20 +40,27 @@ export default {
* @param {object} props
* @param {string} props.audioId
* @param {any} props.service
- * @return {{ audios: Ref<AudioDetail[]> }}
+ * @return {{ audios: import('~/composables/types').Ref<import('~/store/types').AudioDetail[]>, audioTrackSize: import('@nuxtjs/composition-api').ComputedRef<"l" | "s"> }}
*/
setup(props) {
const mainAudioId = ref(props.audioId)
const relatedOptions = {
mediaType: AUDIO,
mediaId: mainAudioId,
+ service: undefined,
}
// Using service prop to be able to mock when testing
if (props.service) {
relatedOptions.service = props.service
}
+
+ const isMinScreenMd = isMinScreen('md', { shouldPassInSSR: true })
+ const audioTrackSize = computed(() => {
+ return isMinScreenMd.value ? 'l' : 's'
+ })
+
const { media: audios } = useRelated(relatedOptions)
- return { audios }
+ return { audioTrackSize, audios }
},
}
</script>
diff --git a/src/components/DropdownButton.vue b/src/components/DropdownButton.vue
index e00daa235..37b2bc5a9 100644
--- a/src/components/DropdownButton.vue
+++ b/src/components/DropdownButton.vue
@@ -1,10 +1,12 @@
<template>
- <div class="relative block max-w-min">
+ <div class="relative block max-w-min text-sm md:text-base">
<!-- rounded-X-none is required to fight Edge UA styles that apply a 2px border radius to all `button` elements -->
<div class="flex">
<slot
:button-props="{
- class: `dropdown-button rounded-s-sm rounded-e-none dropdown-button-${size}`,
+ class: `dropdown-button rounded-s-sm ${
+ isSingleItem ? 'rounded-e-sm' : 'rounded-e-none'
+ } dropdown-button-${size}`,
type: 'button',
}"
/>
@@ -173,7 +175,7 @@ export default DropdownButton
.dropdown-icon-button-medium,
.dropdown-button-medium {
- @apply p-4 leading-6;
+ @apply py-4 px-6 leading-6;
}
/*
diff --git a/src/components/MediaTag/MediaTag.vue b/src/components/MediaTag/MediaTag.vue
index e8eead05d..54b890904 100644
--- a/src/components/MediaTag/MediaTag.vue
+++ b/src/components/MediaTag/MediaTag.vue
@@ -2,7 +2,7 @@
<Component
:is="tag"
v-bind="$attrs"
- class="text-dark-charcoal-60 text-sm font-semibold py-1 px-2 border border-dark-charcoal-60 rounded-full"
+ class="text-dark-blue text-sr md:text-sm font-semibold px-2 md:px-3 py-1 md:py-2 bg-dark-charcoal-10 rounded-full leading-none inline-flex"
>
<!-- @slot Content goes here -->
<slot />
diff --git a/src/components/VAudioTrack/VAudioTrack.vue b/src/components/VAudioTrack/VAudioTrack.vue
index 38f89187f..be0f3696b 100644
--- a/src/components/VAudioTrack/VAudioTrack.vue
+++ b/src/components/VAudioTrack/VAudioTrack.vue
@@ -6,7 +6,13 @@
v-bind="layoutBasedProps"
v-on="layoutBasedListeners"
>
- <Component :is="layoutComponent" :audio="audio" :size="_size">
+ <Component
+ :is="layoutComponent"
+ :audio="audio"
+ :size="_size"
+ :status="status"
+ :current-time="currentTime"
+ >
<template #controller="waveformProps">
<VWaveform
v-bind="waveformProps"
@@ -351,7 +357,7 @@ export default defineComponent({
if (isBoxed && !props.size) {
return null
}
- return 'm'
+ return props.size ?? 'm'
})
/**
diff --git a/src/components/VAudioTrack/layouts/VFullLayout.vue b/src/components/VAudioTrack/layouts/VFullLayout.vue
index 6d36110ca..24166ca24 100644
--- a/src/components/VAudioTrack/layouts/VFullLayout.vue
+++ b/src/components/VAudioTrack/layouts/VFullLayout.vue
@@ -1,18 +1,39 @@
<template>
<div class="full-track w-full">
- <slot name="controller" />
-
+ <div class="bg-dark-charcoal-06 relative">
+ <span
+ v-if="currentTime > 0"
+ class="pointer-events-none absolute h-full hidden md:block w-4 lg:w-10 left-0 bg-yellow"
+ aria-hidden
+ />
+ <span
+ v-if="status === 'played'"
+ class="pointer-events-none absolute h-full hidden md:block w-4 lg:w-10 right-0 bg-yellow"
+ aria-hidden
+ />
+ <div class="md:mx-4 lg:mx-10">
+ <slot
+ name="controller"
+ :features="['timestamps', 'duration', 'seek']"
+ :usable-frac="0.8"
+ />
+ </div>
+ </div>
<div
- class="flex flex-row flex-wrap items-top mx-6 sm:mx-16 my-4 sm:my-6 gap-6"
+ class="flex flex-row flex-wrap lg:flex-nowrap items-top px-4 lg:px-0 lg:max-w-5xl mx-auto gap-6 mt-6"
>
<slot name="play-pause" :size="isSmall ? 'small' : 'medium'" />
- <div class="audio-info order-2 sm:order-1 w-full sm:w-auto">
- <h1 class="text-base sm:text-3xl font-heading font-semibold">
+ <div
+ class="audio-info order-2 lg:order-1 w-full lg:w-auto flex flex-col justify-center"
+ >
+ <h1
+ class="text-base lg:text-3xl font-heading font-semibold lg:line-clamp-2"
+ >
{{ audio.title }}
</h1>
<div
- class="subtitle mt-1 flex flex-col sm:flex-row sm:items-center gap-2"
+ class="subtitle mt-1 flex flex-col lg:flex-row lg:items-center gap-2"
>
<i18n
as="span"
@@ -23,12 +44,13 @@
<a
class="p-px rounded-sm focus:outline-none focus:ring focus:ring-pink"
:href="audio.creator_url"
- >{{ audio.creator }}</a
>
+ {{ audio.creator }}
+ </a>
</template>
</i18n>
- <span v-if="!isSmall" class="text-dark-charcoal-70">{{
+ <span class="hidden lg:block text-dark-charcoal-70">{{
$t('interpunct')
}}</span>
@@ -37,7 +59,7 @@
</div>
<DownloadButton
- class="ms-auto order-1 sm:order-2"
+ class="ms-auto order-1 lg:order-2"
:formats="getFormats(audio)"
:size="isSmall ? 'small' : 'medium'"
/>
@@ -55,7 +77,7 @@ export default defineComponent({
components: {
DownloadButton,
},
- props: ['audio', 'size'],
+ props: ['audio', 'size', 'status', 'currentTime'],
setup(props) {
/**
* Format the time as hh:mm:ss, dropping the hour part if it is zero.
@@ -127,7 +149,7 @@ export default defineComponent({
<style>
.full-track .waveform {
- @apply h-30 rounded-sm;
+ @apply h-[185px] rounded-sm;
}
.full-track .play-pause {
diff --git a/src/components/VBackToSearchResultsLink.vue b/src/components/VBackToSearchResultsLink.vue
new file mode 100644
index 000000000..9b4bc3bba
--- /dev/null
+++ b/src/components/VBackToSearchResultsLink.vue
@@ -0,0 +1,39 @@
+<template>
+ <!-- @todo: Seperate the absolute container from the link itself. -->
+ <NuxtLink
+ v-if="show"
+ class="px-2 pt-1 md:px-6 md:pt-4 md:pb-2 flex flex-row items-center font-semibold text-dark-charcoal text-xs md:text-sr"
+ :to="path"
+ >
+ <Chevron class="-ms-2" />
+ {{ $t('single-result.back') }}
+ </NuxtLink>
+</template>
+
+<script>
+import { defineComponent } from '@vue/composition-api'
+import Chevron from '~/assets/icons/chevron-left.svg?inline'
+
+export default defineComponent({
+ components: {
+ Chevron,
+ },
+ data() {
+ return {
+ /** @type {undefined|string} */
+ path: undefined,
+ show: false,
+ }
+ },
+ created() {
+ if (!this.$nuxt?.context?.from?.fullPath) {
+ return
+ }
+
+ this.path = this.$nuxt.context.from.fullPath
+ if (this.path.startsWith('/search')) {
+ this.show = true
+ }
+ },
+})
+</script>
diff --git a/src/components/VMediaInfo/VCopyLicense.vue b/src/components/VMediaInfo/VCopyLicense.vue
index a4f312de3..41183b62f 100644
--- a/src/components/VMediaInfo/VCopyLicense.vue
+++ b/src/components/VMediaInfo/VCopyLicense.vue
@@ -4,7 +4,7 @@
{{ $t('media-details.reuse.copy-license.title') }}
</h5>
- <nav class="flex borber-b-none" role="tablist">
+ <nav class="flex border-b-none" role="tablist">
<button
v-for="(tab, idx) in tabs"
:key="idx"
@@ -31,117 +31,118 @@
:aria-labelledby="tab"
role="tabpanel"
tabindex="0"
- class="border border-dark-charcoal-20 p-4 md:p-6 text-sm md:text-base foxus:border-tx focus:outline-none focus:shadow-[0_0_0_1.5px_#c52b9b_inset]"
+ class="border border-dark-charcoal-20 p-4 md:p-6 text-sm md:text-base foxus:border-tx focus:outline-none focus:shadow-[0_0_0_1.5px_#c52b9b_inset] h-[190px] flex flex-col justify-between items-start"
:class="{ hidden: activeTab !== tab }"
>
- <i18n
- v-if="tab === 'rich'"
- id="attribution-rich"
- path="media-details.reuse.credit.text"
- tag="p"
- >
- <template #title>
- <a
- :href="media.foreign_landing_url"
- target="_blank"
- rel="noopener"
- @click="onSourceLinkClicked"
- @keyup.enter="onSourceLinkClicked"
- >{{ media.title }}</a
- ></template
+ <div class="flex-grow-1 overflow-y-scroll w-full">
+ <i18n
+ v-if="tab === 'rich'"
+ id="attribution-rich"
+ path="media-details.reuse.credit.text"
+ tag="p"
>
- <template #creator>
- <i18n
- v-if="media.creator"
- path="media-details.reuse.credit.creator-text"
- tag="span"
- >
- <template #creator-name>
- <a
- v-if="media.creator_url"
- :href="media.creator_url"
- target="_blank"
- rel="noopener"
- @click="onCreatorLinkClicked"
- @keyup.enter="onCreatorLinkClicked"
- >{{ media.creator }}</a
- >
- <span v-else>{{ media.creator }}</span>
- </template>
- </i18n>
- </template>
- <template #marked-licensed>
- {{
- isPDM
- ? $t('media-details.reuse.credit.marked')
- : $t('media-details.reuse.credit.licensed')
- }}
- </template>
- <template #license>
- <a
- class="uppercase"
- :href="licenseUrl"
- target="_blank"
- rel="noopener"
- >{{ fullLicenseName }}</a
+ <template #title>
+ <a
+ :href="media.foreign_landing_url"
+ target="_blank"
+ rel="noopener"
+ @click="onSourceLinkClicked"
+ @keyup.enter="onSourceLinkClicked"
+ >{{ media.title }}</a
+ ></template
>
- </template>
- </i18n>
-
- <label v-if="tab === 'html'" for="attribution-html">
- <textarea
- id="attribution-html"
- class="w-full font-mono h-auto resize-none"
- :value="attributionHtml"
- rows="4"
- dir="ltr"
- readonly
- />
- </label>
-
- <i18n
- v-if="tab === 'plain'"
- id="attribution-plain"
- path="media-details.reuse.credit.text"
- tag="p"
- >
- <template #title>{{ media.title }}</template>
- <template #creator>
- <i18n
- v-if="media.creator"
- path="media-details.reuse.credit.creator-text"
+ <template #creator>
+ <i18n
+ v-if="media.creator"
+ path="media-details.reuse.credit.creator-text"
+ tag="span"
+ >
+ <template #creator-name>
+ <a
+ v-if="media.creator_url"
+ :href="media.creator_url"
+ target="_blank"
+ rel="noopener"
+ @click="onCreatorLinkClicked"
+ @keyup.enter="onCreatorLinkClicked"
+ >{{ media.creator }}</a
+ >
+ <span v-else>{{ media.creator }}</span>
+ </template>
+ </i18n>
+ </template>
+ <template #marked-licensed>
+ {{
+ isPDM
+ ? $t('media-details.reuse.credit.marked')
+ : $t('media-details.reuse.credit.licensed')
+ }}
+ </template>
+ <template #license>
+ <a
+ class="uppercase"
+ :href="licenseUrl"
+ target="_blank"
+ rel="noopener"
+ >{{ fullLicenseName }}</a
+ >{{ period }}
+ </template>
+ </i18n>
+ <label v-if="tab === 'html'" for="attribution-html" class="w-full">
+ <div
+ id="attribution-html"
+ class="w-full font-mono h-auto w-full resize-none"
+ :value="attributionHtml"
+ dir="ltr"
+ readonly
>
- <template #creator-name>{{ media.creator }}</template>
- </i18n>
- </template>
- <template #marked-licensed>
- {{
- isPDM
- ? $t('media-details.reuse.credit.marked')
- : $t('media-details.reuse.credit.licensed')
- }}
- </template>
- <template #license> {{ fullLicenseName }}</template>
- <template #view-legal>
- <i18n path="media-details.reuse.credit.view-legal-text">
- <template #terms-copy>
- {{
- isPDM
- ? $t('media-details.reuse.credit.terms-text')
- : $t('media-details.reuse.credit.copy-text')
- }}
- </template>
- <template v-if="licenseUrl" #URL>
- {{ licenseUrl }}
- </template>
- </i18n>
- </template>
- </i18n>
+ {{ attributionHtml }}
+ </div>
+ </label>
+ <i18n
+ v-if="tab === 'plain'"
+ id="attribution-plain"
+ path="media-details.reuse.credit.text"
+ tag="p"
+ >
+ <template #title>{{ media.title }}</template>
+ <template #creator>
+ <i18n
+ v-if="media.creator"
+ path="media-details.reuse.credit.creator-text"
+ >
+ <template #creator-name>{{ media.creator }}</template>
+ </i18n>
+ </template>
+ <template #marked-licensed>
+ {{
+ isPDM
+ ? $t('media-details.reuse.credit.marked')
+ : $t('media-details.reuse.credit.licensed')
+ }}
+ </template>
+ <template #license> {{ fullLicenseName }}</template>
+ <template #view-legal>
+ <i18n path="media-details.reuse.credit.view-legal-text">
+ <template #terms-copy>
+ {{
+ isPDM
+ ? $t('media-details.reuse.credit.terms-text')
+ : $t('media-details.reuse.credit.copy-text')
+ }}
+ </template>
+ <template v-if="licenseUrl" #URL>
+ {{ licenseUrl }}
+ </template>
+ </i18n>
+ </template>
+ </i18n>
+ </div>
<CopyButton
:id="`copyattr-${tab}`"
:el="`#attribution-${tab}`"
- class="mt-6 md:mt-10"
+ class="mt-6"
@copied="(e) => onCopyAttribution(tab, e)"
/>
</div>
@@ -218,6 +219,8 @@ const VCopyLicense = defineComponent({
sendDetailPageEvent(DETAIL_PAGE_EVENTS.ATTRIBUTION_CLICKED)
}
+ const period = '.'
+
return {
activeTab,
attributionHtml,
@@ -228,6 +231,7 @@ const VCopyLicense = defineComponent({
onCopyAttribution,
tabs,
setActiveTab,
+ period,
}
},
})
diff --git a/src/locales/en.json b/src/locales/en.json
index 1efed95aa..b61d4996f 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -528,8 +528,10 @@
}
}
},
+ "single-result": {
+ "back": "Back to search results"
+ },
"image-details": {
- "back": "Back to search results",
"creator": "by {name}",
"weblink": "Go to image's website",
"information": {
@@ -548,7 +550,7 @@
},
"audio-details": {
"genre-label": "Genre",
- "related-audios": "Related audios",
+ "related-audios": "Related audio",
"table": {
"album": "Album",
"category": "Type",
@@ -557,7 +559,8 @@
"provider": "Provider",
"source": "Source",
"genre": "Genre"
- }
+ },
+ "information": "Audio information"
},
"meta-search": {
"caption": "Openverse does not currently index the sources listed above, but through this interface is offering convenient access to search services provided by other independent organizations. Openverse has no control over the results that are returned. Do not assume that the results displayed in this search portal are under a CC license. Always verify that the work is actually under a CC license by following the link. If you are in doubt, you should contact the copyright holder directly, or try to contact the site where you found the content.",
diff --git a/src/locales/po-files/openverse.pot b/src/locales/po-files/openverse.pot
index 9c6b419ee..c2f6c5c38 100644
--- a/src/locales/po-files/openverse.pot
+++ b/src/locales/po-files/openverse.pot
@@ -13,7 +13,7 @@ msgstr ""
"Language-Team: LANGUAGE <[email protected]>\n"
-#: src/components/VAudioTrack/layouts/VFullLayout.vue:32
+#: src/components/VAudioTrack/layouts/VFullLayout.vue:39
msgctxt "interpunct"
msgid "•"
msgstr ""
@@ -93,7 +93,7 @@ msgctxt "migration-notice.read"
msgid "Read more"
msgstr ""
-#: src/components/DropdownButton.vue:83
+#: src/components/DropdownButton.vue:85
msgctxt "dropdown-button.aria.arrow-label"
msgid "Dropdown"
msgstr ""
@@ -205,7 +205,7 @@ msgid "Audio Player"
msgstr ""
#. Do not translate words between ### ###.
-#: src/components/VAudioTrack/layouts/VFullLayout.vue:17
+#: src/components/VAudioTrack/layouts/VFullLayout.vue:23
msgctxt "audio-track.creator"
msgid "by ###creator###"
msgstr ""
@@ -325,49 +325,49 @@ msgstr ""
#: src/components/AudioDetails/VRelatedAudio.vue:4
msgctxt "audio-details.related-audios"
-msgid "Related audios"
+msgid "Related audio"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:12
+#: src/components/AudioDetails/VAudioDetails.vue:5
+msgctxt "audio-details.information"
+msgid "Audio information"
+msgstr ""
+
+#: src/components/AudioDetails/VAudioDetails.vue:24
msgctxt "audio-details.table.album"
msgid "Album"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:18
+#: src/components/AudioDetails/VAudioDetails.vue:30
msgctxt "audio-details.table.category"
msgid "Type"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:25
+#: src/components/AudioDetails/VAudioDetails.vue:37
msgctxt "audio-details.table.sample-rate"
msgid "Sample Rate"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:33
+#: src/components/AudioDetails/VAudioDetails.vue:45
msgctxt "audio-details.table.filetype"
msgid "Format"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:41
+#: src/components/AudioDetails/VAudioDetails.vue:53
msgctxt "audio-details.table.provider"
msgid "Provider"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:49
+#: src/components/AudioDetails/VAudioDetails.vue:67
msgctxt "audio-details.table.source"
msgid "Source"
msgstr ""
-#: src/components/AudioDetails/VAudioDetails.vue:57
+#: src/components/AudioDetails/VAudioDetails.vue:75
msgctxt "audio-details.table.genre"
msgid "Genre"
msgstr ""
-#: src/pages/image/_id.vue:10
-msgctxt "image-details.back"
-msgid "Back to search results"
-msgstr ""
-
#. Do not translate words between ### ###.
#: src/pages/image/_id.vue:49
msgctxt "image-details.creator"
@@ -424,6 +424,11 @@ msgctxt "image-details.information.unknown"
msgid "Unknown"
msgstr ""
+#: src/pages/audio/_id.vue:25
+msgctxt "single-result.back"
+msgid "Back to search results"
+msgstr ""
+
msgctxt "media-details.provider-label"
msgid "Provider"
msgstr ""
@@ -1083,7 +1088,7 @@ msgid "Couldn't find image with id ###id###"
msgstr ""
#. Do not translate words between ### ###.
-#: src/pages/audio/_id.vue:66
+#: src/pages/audio/_id.vue:87
msgctxt "error.media-not-found"
msgid "Couldn't find ###mediaType### with id ###id###"
msgstr ""
diff --git a/src/pages/audio/_id.vue b/src/pages/audio/_id.vue
index 1160d3849..6a6555cff 100644
--- a/src/pages/audio/_id.vue
+++ b/src/pages/audio/_id.vue
@@ -1,22 +1,23 @@
<template>
- <div :aria-label="$t('photo-details.aria.main')" class="audio-page">
- <VAudioTrack :audio="audio" class="main-track" />
- <VMediaReuse
- data-testid="audio-attribution"
- :media="audio"
- class="my-16 px-4 md:px-0"
- />
- <VAudioDetails
- data-testid="audio-info"
- :audio="audio"
- class="my-16 px-4 lg:px-0"
- />
- <VRelatedAudio
- v-if="audio.id"
- class="my-16 px-4 lg:px-0"
- :audio-id="audio.id"
- />
- </div>
+ <main class="relative">
+ <div class="w-full p-2">
+ <VBackToSearchResultsLink />
+ </div>
+ <VAudioTrack layout="full" :audio="audio" class="main-track" />
+ <div
+ class="mt-10 lg:mt-16 flex flex-col gap-10 lg:gap-16 px-4 lg:px-0 lg:max-w-5xl mx-auto"
+ >
+ <VMediaReuse
+ data-testid="audio-attribution"
+ :media="audio"
+ :license-url="licenseUrl"
+ :full-license-name="fullLicenseName"
+ :attribution-html="attributionHtml()"
+ />
+ <VAudioDetails data-testid="audio-info" :audio="audio" />
+ <VRelatedAudio v-if="audio.id" :audio-id="audio.id" />
+ </div>
+ </main>
</template>
<script>
@@ -34,8 +35,7 @@ const AudioDetailPage = {
data() {
return {
thumbnailURL: null,
- breadCrumbURL: '',
- shouldShowBreadcrumb: false,
+ showBackToSearchLink: false,
id: null,
}
},
@@ -76,8 +76,7 @@ const AudioDetailPage = {
from.name === _this.localeRoute({ path: '/search/' }).name ||
from.name === _this.localeRoute({ path: '/search/audio' }).name
) {
- _this.shouldShowBreadcrumb = true
- _this.breadCrumbURL = from.fullPath
+ _this.showBackToSearchLink = true
}
})
},
diff --git a/src/pages/image/_id.vue b/src/pages/image/_id.vue
index cecc1594a..c17828f56 100644
--- a/src/pages/image/_id.vue
+++ b/src/pages/image/_id.vue
@@ -1,16 +1,13 @@
<template>
<div>
- <a
- v-if="shouldShowBreadcrumb"
- class="px-6 pt-4 flex flex-row items-center bg-dark-charcoal-06 font-semibold text-dark-charcoal text-xs md:text-sr"
- :href="breadcrumbUrl"
- @click.prevent="$router.back()"
- >
- <Chevron class="-ms-2" />
- {{ $t('image-details.back') }}
- </a>
+ <figure class="w-full mb-4 pt-8 md:pt-12 px-6 bg-dark-charcoal-06 relative">
+ <div
+ v-if="showBackToSearchLink"
+ class="absolute left-0 top-0 right-0 z-40 w-full px-2"
+ >
+ <VBackToSearchResultsLink />
+ </div>
- <figure class="w-full mb-4 pt-4 md:pt-8 px-6 bg-dark-charcoal-06">
<img
v-if="!sketchFabUid"
id="main-image"
@@ -42,7 +39,7 @@
@keyup.enter="onSourceLinkClicked"
>{{ $t('image-details.weblink') }}</VButton
>
- <span class="flex-1">
+ <span class="flex-1 flex flex-col justify-center">
<h1 class="text-base md:text-3xl font-semibold leading-[130%]">
{{ image.title }}
</h1>
@@ -101,12 +98,9 @@ import VMediaReuse from '~/components/VMediaInfo/VMediaReuse.vue'
import VRelatedImages from '~/components/VImageDetails/VRelatedImages.vue'
import SketchFabViewer from '~/components/SketchFabViewer.vue'
-import Chevron from '~/assets/icons/chevron-left.svg?inline'
-
const VImageDetailsPage = {
name: 'VImageDetailsPage',
components: {
- Chevron,
VButton,
VIcon,
VImageDetails,
@@ -116,8 +110,7 @@ const VImageDetailsPage = {
},
data() {
return {
- breadcrumbUrl: '',
- shouldShowBreadcrumb: false,
+ showBackToSearchLink: false,
imageWidth: 0,
imageHeight: 0,
imageType: 'Unknown',
@@ -160,8 +153,7 @@ const VImageDetailsPage = {
from.name === _this.localeRoute({ path: '/search/' }).name ||
from.name === _this.localeRoute({ path: '/search/image' }).name
) {
- _this.shouldShowBreadcrumb = true
- _this.breadcrumbUrl = from.fullPath
+ _this.showBackToSearchLink = true
}
})
},