refactor(front): playlist detail and edit
This commit is contained in:
parent
7405d4009e
commit
17abed6b76
|
@ -216,16 +216,23 @@ const insertMany = async (insertedTracks: number[], allowDuplicates: boolean) =>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<Button
|
<Button
|
||||||
primary
|
destructive
|
||||||
@click="insertMany(queueTracks, true)"
|
@click="insertMany(queueTracks, true)"
|
||||||
>
|
>
|
||||||
{{ t('components.playlists.Editor.button.addDuplicate') }}
|
{{ t('components.playlists.Editor.button.addDuplicate') }}
|
||||||
</Button>
|
</Button>
|
||||||
</Alert>
|
</Alert>
|
||||||
<template v-else-if="status === 'saved'">
|
<Alert
|
||||||
<i class="success bi- bi-check" />
|
v-else-if="status === 'saved'"
|
||||||
|
green
|
||||||
|
align-content="center"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
<i class="bi bi-check" />
|
||||||
{{ t('components.playlists.Editor.message.sync') }}
|
{{ t('components.playlists.Editor.message.sync') }}
|
||||||
</template>
|
</span>
|
||||||
|
</Alert>
|
||||||
|
<Layout flex>
|
||||||
<Button
|
<Button
|
||||||
:disabled="queueTracks.length === 0"
|
:disabled="queueTracks.length === 0"
|
||||||
primary
|
primary
|
||||||
|
@ -252,7 +259,7 @@ const insertMany = async (insertedTracks: number[], allowDuplicates: boolean) =>
|
||||||
{{ t('components.playlists.Editor.button.clear') }}
|
{{ t('components.playlists.Editor.button.clear') }}
|
||||||
</template>
|
</template>
|
||||||
</dangerous-button>
|
</dangerous-button>
|
||||||
<div class="ui hidden divider" />
|
</Layout>
|
||||||
<template v-if="tracks.length > 0">
|
<template v-if="tracks.length > 0">
|
||||||
<p>
|
<p>
|
||||||
{{ t('components.playlists.Editor.help.reorder') }}
|
{{ t('components.playlists.Editor.help.reorder') }}
|
||||||
|
@ -276,12 +283,12 @@ const insertMany = async (insertedTracks: number[], allowDuplicates: boolean) =>
|
||||||
v-if="plt.track.album && plt.track.album.cover && plt.track.album.cover.urls.original"
|
v-if="plt.track.album && plt.track.album.cover && plt.track.album.cover.urls.original"
|
||||||
v-lazy="store.getters['instance/absoluteUrl'](plt.track.album.cover.urls.medium_square_crop)"
|
v-lazy="store.getters['instance/absoluteUrl'](plt.track.album.cover.urls.medium_square_crop)"
|
||||||
alt=""
|
alt=""
|
||||||
class="ui mini image"
|
style="width: 40px;"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-else
|
v-else
|
||||||
alt=""
|
alt=""
|
||||||
class="ui mini image"
|
style="width: 40px;"
|
||||||
src="../../assets/audio/default-cover.png"
|
src="../../assets/audio/default-cover.png"
|
||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
|
@ -290,14 +297,16 @@ const insertMany = async (insertedTracks: number[], allowDuplicates: boolean) =>
|
||||||
{{ generateTrackCreditString(plt.track) }}
|
{{ generateTrackCreditString(plt.track) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="right aligned">
|
<td class="right aligned">
|
||||||
<button
|
<Button
|
||||||
class="ui circular danger basic icon button"
|
square-small
|
||||||
|
round
|
||||||
|
destructive
|
||||||
@click.stop="removePlaylistTrack(index)"
|
@click.stop="removePlaylistTrack(index)"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
class="trash icon"
|
class="bi bi-trash"
|
||||||
/>
|
/>
|
||||||
</button>
|
</Button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -107,18 +107,6 @@ const showDeleteModal = ref(false)
|
||||||
<OptionsButton @click="toggleOpen" />
|
<OptionsButton @click="toggleOpen" />
|
||||||
</template>
|
</template>
|
||||||
<template #items>
|
<template #items>
|
||||||
<PopoverItem
|
|
||||||
v-if="store.state.auth.profile && playlist.actor.full_username === store.state.auth.fullUsername"
|
|
||||||
@click="edit = !edit"
|
|
||||||
icon="bi-pencil"
|
|
||||||
>
|
|
||||||
<template v-if="edit">
|
|
||||||
{{ t('views.playlists.Detail.button.stopEdit') }}
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
{{ t('views.playlists.Detail.button.edit') }}
|
|
||||||
</template>
|
|
||||||
</PopoverItem>
|
|
||||||
<PopoverItem
|
<PopoverItem
|
||||||
v-if="playlist.privacy_level === 'everyone' && playlist.is_playable"
|
v-if="playlist.privacy_level === 'everyone' && playlist.is_playable"
|
||||||
icon="bi-code-slash"
|
icon="bi-code-slash"
|
||||||
|
|
|
@ -248,17 +248,12 @@ const deletePlaylist = async () => {
|
||||||
<Button
|
<Button
|
||||||
primary
|
primary
|
||||||
icon="bi-pencil"
|
icon="bi-pencil"
|
||||||
|
align-self="center"
|
||||||
@click="edit = !edit"
|
@click="edit = !edit"
|
||||||
>
|
>
|
||||||
{{ t('views.playlists.Detail.button.edit') }}
|
{{ t('views.playlists.Detail.button.edit') }}
|
||||||
</Button>
|
</Button>
|
||||||
</Alert>
|
</Alert>
|
||||||
<library-widget
|
|
||||||
:url="'playlists/' + playlist?.id + '/libraries/'"
|
|
||||||
@loaded="emit('libraries-loaded', $event)"
|
|
||||||
>
|
|
||||||
{{ t('components.library.AlbumDetail.description.libraries') }}
|
|
||||||
</library-widget>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
</Layout>
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue