[web] Remove button section when not present

This commit is contained in:
Alain Nussbaumer 2025-02-15 20:15:58 +01:00
parent b477121dda
commit 570c663178
3 changed files with 64 additions and 59 deletions

View File

@ -2,7 +2,7 @@
<modal-dialog :actions="actions" :show="show" @close="$emit('close')"> <modal-dialog :actions="actions" :show="show" @close="$emit('close')">
<template #content> <template #content>
<list-properties :item="item"> <list-properties :item="item">
<template #buttons> <template v-if="buttons.length" #buttons>
<div class="buttons"> <div class="buttons">
<a <a
v-for="button in buttons" v-for="button in buttons"
@ -27,7 +27,7 @@ export default {
name: 'ModalDialogPlayable', name: 'ModalDialogPlayable',
components: { ListProperties, ModalDialog }, components: { ListProperties, ModalDialog },
props: { props: {
buttons: { default: null, type: Array }, buttons: { default: () => [], type: Array },
item: { required: true, type: Object }, item: { required: true, type: Object },
show: Boolean show: Boolean
}, },

View File

@ -28,17 +28,12 @@ export default {
}, },
computed: { computed: {
buttons() { buttons() {
if (this.item.media_kind === 'podcast') { if (this.item.media_kind !== 'podcast') {
if (this.item.play_count > 0) { return []
return [{ label: 'dialog.track.mark-as-new', handler: this.mark_new }]
}
if (this.item.play_count === 0) {
return [
{ label: 'dialog.track.mark-as-played', handler: this.mark_played }
]
}
} }
return [] return this.item.play_count > 0
? [{ label: 'dialog.track.mark-as-new', handler: this.mark_new }]
: [{ label: 'dialog.track.mark-as-played', handler: this.mark_played }]
}, },
playable() { playable() {
return { return {

View File

@ -10,57 +10,67 @@
class="content" class="content"
v-text="$t('page.settings.artwork.explanation-1')" v-text="$t('page.settings.artwork.explanation-1')"
/> />
<control-setting-switch category="artwork" name="streamurl_ignore"> <div class="content">
<template #label> <control-setting-switch category="artwork" name="streamurl_ignore">
<span v-text="$t('page.settings.artwork.streaming')" /> <template #label>
</template> <span v-text="$t('page.settings.artwork.streaming')" />
</control-setting-switch> </template>
<control-setting-switch </control-setting-switch>
category="artwork" <control-setting-switch
name="show_cover_artwork_in_album_lists" category="artwork"
> name="show_cover_artwork_in_album_lists"
<template #label> >
<span v-text="$t('page.settings.artwork.show-coverart')" /> <template #label>
</template> <span v-text="$t('page.settings.artwork.show-coverart')" />
</control-setting-switch> </template>
</control-setting-switch>
</div>
<div <div
class="content" class="content"
v-text="$t('page.settings.artwork.explanation-2')" v-text="$t('page.settings.artwork.explanation-2')"
/> />
<control-setting-switch <div class="content">
v-if="spotify.spotify_logged_in" <control-setting-switch
category="artwork" v-if="spotify.spotify_logged_in"
name="use_artwork_source_spotify" category="artwork"
> name="use_artwork_source_spotify"
<template #label> >
<span v-text="$t('page.settings.artwork.spotify')" /> <template #label>
<a href="https://www.spotify.com/" target="_blank"> <span v-text="$t('page.settings.artwork.spotify')" />
<span class="icon"><mdicon name="open-in-new" size="16" /></span> <a href="https://www.spotify.com/" target="_blank">
</a> <span class="icon">
</template> <mdicon name="open-in-new" size="16" />
</control-setting-switch> </span>
<control-setting-switch </a>
category="artwork" </template>
name="use_artwork_source_discogs" </control-setting-switch>
> <control-setting-switch
<template #label> category="artwork"
<span v-text="$t('page.settings.artwork.discogs')" /> name="use_artwork_source_discogs"
<a href="https://www.discogs.com/" target="_blank"> >
<span class="icon"><mdicon name="open-in-new" size="16" /></span> <template #label>
</a> <span v-text="$t('page.settings.artwork.discogs')" />
</template> <a href="https://www.discogs.com/" target="_blank">
</control-setting-switch> <span class="icon">
<control-setting-switch <mdicon name="open-in-new" size="16" />
category="artwork" </span>
name="use_artwork_source_coverartarchive" </a>
> </template>
<template #label> </control-setting-switch>
<span v-text="$t('page.settings.artwork.coverartarchive')" /> <control-setting-switch
<a href="https://coverartarchive.org/" target="_blank"> category="artwork"
<span class="icon"><mdicon name="open-in-new" size="16" /></span> name="use_artwork_source_coverartarchive"
</a> >
</template> <template #label>
</control-setting-switch> <span v-text="$t('page.settings.artwork.coverartarchive')" />
<a href="https://coverartarchive.org/" target="_blank">
<span class="icon">
<mdicon name="open-in-new" size="16" />
</span>
</a>
</template>
</control-setting-switch>
</div>
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>