Merge pull request 'Flat Album dialog' (#34) from dev into main
All checks were successful
continuous-integration/drone Build is passing

Reviewed-on: #34
This commit is contained in:
Artem Anufrij 2023-11-05 18:15:02 +01:00
commit 3dd098584c
4 changed files with 91 additions and 77 deletions

View File

@ -625,9 +625,8 @@ td.fillCell>* {
} }
#artists .artistCover { #artists .artistCover {
min-width: 100%; width: 160px;
height: initial; height: initial;
min-height: 128px;
} }
#artists .artistName { #artists .artistName {

View File

@ -420,6 +420,7 @@ export default {
flex-grow: 1; flex-grow: 1;
} }
.dialog-window.fullscreen
.dialog-body.flat-dialog-header { .dialog-body.flat-dialog-header {
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;

View File

@ -1,72 +1,89 @@
<template> <template>
<DialogBase ref="dialogWindow" :title="album_title" @canceled="closed" :showFooter="false" :disableXscroll="true" :disableYscroll="true"> <DialogBase ref="dialogWindow" :title="album_title" @canceled="closed" :showFooter="false" :disableXscroll="true" :disableYscroll="true" :flatDialogHeader="true">
<div id="albumViewer" class="flex-row"> <div id="albumViewer" class="flex-row">
<div id="header" class="flex-column"> <div id="header" class="flex-column grow">
<div id="background" :style="coverBackground" /> <div id="background" :style="coverBackground" />
<div class="grow z1 center flex-column"> <div it="title" class="flex-column pa grow z1">
<img class="glow ma24" :src="cover" @dblclick="dblclick" /> <img class="glow ma" :src="cover" />
</div>
<awesome-icon icon="star" size="2x" class="favourite ma4" :class="{ active: isFavourite }" @click="toggleFavourite" title="Favourite" /> <span id="stats" class="center">
<awesome-icon icon="play" size="2x" class="keepPlaying ma4 primary-text" @click="playProgress" v-if="selectedAlbum.progress" title="Keep playing" /> {{ selectedAlbum.title }}
<div id="stats" class="flex-row z1"> <br />
<DropDown v-if="$store.getters['user/isAdministrator']"> by
<button class="flat center" :title="visibility_text"> <b @click="gotoArtist" class="pointer">{{ selectedAlbum.artist_name }}</b>
<awesome-icon :icon="visibility_icon" /> <br />
</button> <span v-if="album_year">
<template v-slot:dropdown-content> from year <b>{{ album_year }}</b> </span><br />
<div> <b>{{ album_tracks.length }}</b> Tracks with a duration of
<button v-for="(item, i) in $store.state.system.lists.visibility" :key="i" @click="setVisibility(item)"> <b>{{ album_duration }}</b>
<awesome-icon :icon="getVisibilityIcon(item)" />{{
getVisibilityText(item) </span>
}} <div class=" grow">
</button>
<hr />
<button v-if="!selectedAlbum.share._id" @click="shareEnable">
<awesome-icon icon="share" />Share this album
</button>
<button v-if="selectedAlbum.share._id" @click="addShareUrlToClipboard">
<awesome-icon icon="clipboard" />Copy url into clipboard
</button>
<button v-if="selectedAlbum.share._id" @click="shareDisable">
<awesome-icon icon="share" />Remove share
</button>
</div>
</template>
</DropDown>
<div class="grow flex-column">
<p class="ma4 center">
<span class="grow center">
by
<b @click="gotoArtist" class="pointer">{{
selectedAlbum.artist_name
}}</b>
<br />
<span v-if="album_year">
from year <b>{{ album_year }}</b> </span><br />
<b>{{ album_tracks.length }}</b> Tracks with a duration of
<b>{{ album_duration }}</b>
</span>
</p>
</div> </div>
<DropDown v-if="$store.getters['user/isAdministrator']"> <div class="flex-row grow ma-top">
<button class="flat center">
<awesome-icon icon="ellipsis-v" /> <button class="flat ma-right" title="Favourite" @click="toggleFavourite">
<awesome-icon :icon="['fas', 'star']" size="2x" class="white-text favourite active" v-if="isFavourite" />
<awesome-icon :icon="['far', 'star']" size="2x" class="white-text favourite" v-else />
</button> </button>
<template v-slot:dropdown-content> <button class="flat ma-right" @click="playProgress" v-if="selectedAlbum.progress">
<div> <awesome-icon icon="play" size="2x" class="primary-text" title="Keep playing" />
<button @click="uploadNewCover"> </button>
<awesome-icon icon="image" />Set new Cover... <button class="flat ma-right" @click="playAlbum" v-else>
</button> <awesome-icon icon="play" size="2x" class="white-text" title="Play" />
<button @click="resetCover"> </button>
<awesome-icon icon="eraser" />Reset Cover <button @click="gotoPrevAlbum" class="flat ma-left ma-right" :title="prevAlbum.name" :disabled="!prevAlbum._id">
</button> <awesome-icon icon="angle-left" class="ma4 white-text" />
<hr /> </button>
<button @click="mergeAlbum"> <button @click="gotoNextAlbum" class="flat" :title="nextAlbum.name" :disabled="!nextAlbum._id">
<awesome-icon icon="compress-alt" />Merge Albums... <awesome-icon icon="angle-right" class="ma4 white-text" />
</button> </button>
</div> <div class="grow"></div>
</template> <DropDown v-if="$store.getters['user/isAdministrator']">
</DropDown> <button class="flat center" :title="visibility_text">
<awesome-icon :icon="visibility_icon" class="white-text" />
</button>
<template v-slot:dropdown-content>
<div>
<button v-for="(item, i) in $store.state.system.lists.visibility" :key="i" @click="setVisibility(item)">
<awesome-icon :icon="getVisibilityIcon(item)" />{{
getVisibilityText(item)
}}
</button>
<hr />
<button v-if="!selectedAlbum.share._id" @click="shareEnable">
<awesome-icon icon="share" />Share this album
</button>
<button v-if="selectedAlbum.share._id" @click="addShareUrlToClipboard">
<awesome-icon icon="clipboard" />Copy url into clipboard
</button>
<button v-if="selectedAlbum.share._id" @click="shareDisable">
<awesome-icon icon="share" />Remove share
</button>
</div>
</template>
</DropDown>
<DropDown v-if="$store.getters['user/isAdministrator']">
<button class="flat center">
<awesome-icon icon="ellipsis-v" class="white-text" />
</button>
<template v-slot:dropdown-content>
<div>
<button @click="uploadNewCover">
<awesome-icon icon="image" />Set new Cover...
</button>
<button @click="resetCover">
<awesome-icon icon="eraser" />Reset Cover
</button>
<hr />
<button @click="mergeAlbum">
<awesome-icon icon="compress-alt" />Merge Albums...
</button>
</div>
</template>
</DropDown>
</div>
</div> </div>
</div> </div>
<ul id="trackList" class="tracks"> <ul id="trackList" class="tracks">
@ -100,7 +117,7 @@ export default {
window.location.origin + "/#/share?id=" + this.selectedAlbum.share._id; window.location.origin + "/#/share?id=" + this.selectedAlbum.share._id;
navigator.clipboard.writeText(url); navigator.clipboard.writeText(url);
}, },
dblclick() { playAlbum() {
this.$store.commit("tracks/resetSelectedTrack"); this.$store.commit("tracks/resetSelectedTrack");
this.$store.commit("radios/resetSelectedRadio"); this.$store.commit("radios/resetSelectedRadio");
this.$store.dispatch("tracks/playContainer", this.selectedAlbum); this.$store.dispatch("tracks/playContainer", this.selectedAlbum);
@ -332,11 +349,13 @@ export default {
<style scoped> <style scoped>
#albumViewer { #albumViewer {
height: 366px; height: 400px;
width: 640px; width: 640px;
} }
#header { #header {
width: 304px;
height: 400px;
position: relative; position: relative;
background-color: black; background-color: black;
} }
@ -348,13 +367,8 @@ export default {
#stats { #stats {
z-index: 2; z-index: 2;
align-items: center;
color: var(--white); color: var(--white);
text-shadow: 0 1px 2px black; text-shadow: 0 1px 2px black;
line-height: 1.4;
background-color: #ffffff40;
border-top: 1px solid #ffffff20;
border-bottom: 1px solid #00000020;
} }
.dropdown-activator button { .dropdown-activator button {

View File

@ -17,11 +17,11 @@
<awesome-icon :icon="['fas', 'star']" size="2x" class="white-text favourite active" v-if="isFavourite" /> <awesome-icon :icon="['fas', 'star']" size="2x" class="white-text favourite active" v-if="isFavourite" />
<awesome-icon :icon="['far', 'star']" size="2x" class="white-text favourite" v-else /> <awesome-icon :icon="['far', 'star']" size="2x" class="white-text favourite" v-else />
</button> </button>
<button class="flat ma-right" v-if="selectedArtist.progress"> <button class="flat ma-right" @click="playProgress" title="Keep playing" v-if="selectedArtist.progress">
<awesome-icon icon="play" size="2x" class="primary-text " @click="playProgress" title="Keep playing" /> <awesome-icon icon="play" size="2x" class="primary-text" />
</button> </button>
<button class="flat ma-right" v-else> <button class="flat ma-right" @click="playArtist" title="Play" v-else>
<awesome-icon icon="play" size="2x" class="white-text" @click="playArtist" title="Play" /> <awesome-icon icon="play" size="2x" class="white-text" />
</button> </button>
<button @click="gotoPrevArtist" class="flat ma-left ma-right" :title="prevArtist.name" :disabled="!prevArtist._id"> <button @click="gotoPrevArtist" class="flat ma-left ma-right" :title="prevArtist.name" :disabled="!prevArtist._id">
<awesome-icon icon="angle-left" class="ma4 white-text" /> <awesome-icon icon="angle-left" class="ma4 white-text" />