refactor(front): profile base tabs routerview
This commit is contained in:
parent
eff50f25ea
commit
406e852bea
|
@ -2,9 +2,11 @@
|
||||||
import type { Actor } from '~/types'
|
import type { Actor } from '~/types'
|
||||||
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
||||||
import TrackWidget from '~/components/audio/track/Widget.vue'
|
import TrackWidget from '~/components/audio/track/Widget.vue'
|
||||||
|
import AlbumWidget from '~/components/album/Widget.vue'
|
||||||
import RadioButton from '~/components/radios/Button.vue'
|
import RadioButton from '~/components/radios/Button.vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -14,11 +16,12 @@ interface Props {
|
||||||
defineProps<Props>()
|
defineProps<Props>()
|
||||||
|
|
||||||
const recentActivity = ref(0)
|
const recentActivity = ref(0)
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section>
|
<Layout stack>
|
||||||
<div>
|
|
||||||
<radio-button
|
<radio-button
|
||||||
v-if="recentActivity > 0"
|
v-if="recentActivity > 0"
|
||||||
class="right floated"
|
class="right floated"
|
||||||
|
@ -26,37 +29,39 @@ const recentActivity = ref(0)
|
||||||
:object-id="{username: object.preferred_username, fullUsername: object.full_username}"
|
:object-id="{username: object.preferred_username, fullUsername: object.full_username}"
|
||||||
:client-only="true"
|
:client-only="true"
|
||||||
/>
|
/>
|
||||||
<h2 class="ui header">
|
|
||||||
{{ t('views.auth.ProfileActivity.header.recentlyListened') }}
|
|
||||||
</h2>
|
|
||||||
<div class="ui divider" />
|
|
||||||
<track-widget
|
<track-widget
|
||||||
:url="'history/listenings/'"
|
:url="'history/listenings/'"
|
||||||
:filters="{scope: `actor:${object.full_username}`, ordering: '-creation_date'}"
|
:filters="{ scope: `actor:${object?.full_username}`, ordering: '-creation_date', ...qualityFilters}"
|
||||||
|
:websocket-handlers="['Listen']"
|
||||||
@count="recentActivity = $event"
|
@count="recentActivity = $event"
|
||||||
/>
|
>
|
||||||
</div>
|
<template #title>
|
||||||
<div class="ui hidden divider" />
|
{{ t('components.library.Home.header.recentlyListened') }}
|
||||||
<div>
|
</template>
|
||||||
<h2 class="ui header">
|
</track-widget>
|
||||||
{{ t('views.auth.ProfileActivity.header.recentlyFavorited') }}
|
|
||||||
</h2>
|
|
||||||
<div class="ui divider" />
|
|
||||||
<track-widget
|
<track-widget
|
||||||
:url="'favorites/tracks/'"
|
:url="'favorites/tracks/'"
|
||||||
:filters="{scope: `actor:${object.full_username}`, ordering: '-creation_date'}"
|
:filters="{scope: 'actor:${object.full_username}', ordering: '-creation_date'}"
|
||||||
/>
|
>
|
||||||
</div>
|
<template #title>
|
||||||
<div class="ui hidden divider" />
|
{{ t('components.library.Home.header.recentlyFavorited') }}
|
||||||
<div>
|
</template>
|
||||||
<h2 class="ui header">
|
</track-widget>
|
||||||
{{ t('views.auth.ProfileActivity.header.playlists') }}
|
|
||||||
</h2>
|
|
||||||
<div class="ui divider" />
|
|
||||||
<playlist-widget
|
<playlist-widget
|
||||||
:url="'playlists/'"
|
:url="'playlists/'"
|
||||||
:filters="{scope: `actor:${object.full_username}`, playable: true, ordering: '-modification_date'}"
|
:filters="{scope: `actor:${object.full_username}`, playable: true, ordering: '-modification_date'}"
|
||||||
/>
|
>
|
||||||
</div>
|
<template #title>
|
||||||
</section>
|
{{ t('views.auth.ProfileActivity.header.playlists') }}
|
||||||
|
</template>
|
||||||
|
</playlist-widget>
|
||||||
|
|
||||||
|
<album-widget :filters="{scope: `actor:${object?.full_username}`, playable: true, ordering: '-creation_date', ...qualityFilters}">
|
||||||
|
<template #title>
|
||||||
|
{{ t('components.library.Home.header.recentlyAdded') }}
|
||||||
|
</template>
|
||||||
|
</album-widget>
|
||||||
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -20,9 +20,6 @@ import Tabs from '~/components/ui/Tabs.vue'
|
||||||
import Tab from '~/components/ui/Tab.vue'
|
import Tab from '~/components/ui/Tab.vue'
|
||||||
import LibraryWidget from '~/components/federation/LibraryWidget.vue'
|
import LibraryWidget from '~/components/federation/LibraryWidget.vue'
|
||||||
import ChannelsWidget from '~/components/audio/ChannelsWidget.vue'
|
import ChannelsWidget from '~/components/audio/ChannelsWidget.vue'
|
||||||
import AlbumWidget from '~/components/album/Widget.vue'
|
|
||||||
import TrackWidget from '~/components/audio/track/Widget.vue'
|
|
||||||
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
|
||||||
|
|
||||||
interface Events {
|
interface Events {
|
||||||
(e: 'updated', value: Actor): void
|
(e: 'updated', value: Actor): void
|
||||||
|
@ -133,10 +130,10 @@ const recentActivity = ref(0)
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<Tab :title="t('views.auth.ProfileBase.link.overview')" :to="{name: 'profile.overview', params: routerParams}">
|
<Tab :title="t('views.auth.ProfileBase.link.overview')" :to="{name: 'profile.overview', params: routerParams}">
|
||||||
<h2>{{ t('views.auth.ProfileBase.link.overview') }}</h2>
|
<h2>{{ t('views.auth.ProfileBase.link.overview') }}</h2>
|
||||||
<!-- <router-view
|
<router-view
|
||||||
:object="object"
|
:object="object"
|
||||||
@updated="fetchData"
|
@updated="fetchData"
|
||||||
/> -->
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
|
||||||
<Tab :title="t('views.auth.ProfileOverview.header.libraries')">
|
<Tab :title="t('views.auth.ProfileOverview.header.libraries')">
|
||||||
|
@ -175,42 +172,10 @@ const recentActivity = ref(0)
|
||||||
</Tab>
|
</Tab>
|
||||||
|
|
||||||
<Tab :title="t('views.auth.ProfileBase.link.activity')" :to="{name: 'profile.activity', params: routerParams}">
|
<Tab :title="t('views.auth.ProfileBase.link.activity')" :to="{name: 'profile.activity', params: routerParams}">
|
||||||
<Layout stack>
|
<router-view
|
||||||
<track-widget
|
:object="object"
|
||||||
:url="'history/listenings/'"
|
@updated="fetchData"
|
||||||
:filters="{ scope: `actor:${object?.full_username}`, ordering: '-creation_date', ...qualityFilters}"
|
/>
|
||||||
:websocket-handlers="['Listen']"
|
|
||||||
@count="recentActivity = $event"
|
|
||||||
>
|
|
||||||
<template #title>
|
|
||||||
{{ t('components.library.Home.header.recentlyListened') }}
|
|
||||||
</template>
|
|
||||||
</track-widget>
|
|
||||||
|
|
||||||
<track-widget
|
|
||||||
:url="'favorites/tracks/'"
|
|
||||||
:filters="{scope: 'actor:${object.full_username}', ordering: '-creation_date'}"
|
|
||||||
>
|
|
||||||
<template #title>
|
|
||||||
{{ t('components.library.Home.header.recentlyFavorited') }}
|
|
||||||
</template>
|
|
||||||
</track-widget>
|
|
||||||
|
|
||||||
<playlist-widget
|
|
||||||
:url="'playlists/'"
|
|
||||||
:filters="{scope: `actor:${object.full_username}`, playable: true, ordering: '-modification_date'}"
|
|
||||||
>
|
|
||||||
<template #title>
|
|
||||||
{{ t('views.auth.ProfileActivity.header.playlists') }}
|
|
||||||
</template>
|
|
||||||
</playlist-widget>
|
|
||||||
|
|
||||||
<album-widget :filters="{scope: `actor:${object?.full_username}`, playable: true, ordering: '-creation_date', ...qualityFilters}">
|
|
||||||
<template #title>
|
|
||||||
{{ t('components.library.Home.header.recentlyAdded') }}
|
|
||||||
</template>
|
|
||||||
</album-widget>
|
|
||||||
</Layout>
|
|
||||||
</Tab>
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
@ -58,7 +58,7 @@ const createForm = ref()
|
||||||
href=""
|
href=""
|
||||||
@click.stop.prevent="showCreateModal = true"
|
@click.stop.prevent="showCreateModal = true"
|
||||||
>
|
>
|
||||||
<i class="plus icon" />
|
<i class="bi bi-plus" />
|
||||||
{{ t('views.auth.ProfileOverview.link.addNew') }}
|
{{ t('views.auth.ProfileOverview.link.addNew') }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -71,7 +71,7 @@ const createForm = ref()
|
||||||
class="actions"
|
class="actions"
|
||||||
>
|
>
|
||||||
<router-link :to="{name: 'content.libraries.index'}">
|
<router-link :to="{name: 'content.libraries.index'}">
|
||||||
<i class="plus icon" />
|
<i class="bi bi-plus" />
|
||||||
{{ t('views.auth.ProfileOverview.link.addNew') }}
|
{{ t('views.auth.ProfileOverview.link.addNew') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue