playlist: change to tile layout

This commit is contained in:
Thomas Amland 2020-07-31 20:01:16 +02:00
parent bf320d283b
commit 6886e2668b
2 changed files with 11 additions and 28 deletions

View File

@ -1,32 +1,14 @@
<template> <template>
<div> <Tiles square>
<b-table-simple> <Tile v-for="item in playlists" :key="item.id"
<thead> :image="item.image"
<tr> :to="{name: 'playlist', params: { id: item.id } }"
<th>Name</th> :title="item.name">
<th>Created</th> <template v-slot:text>
<th>Updated</th> <strong>{{ item.songCount }}</strong> songs
<th></th> </template>
</tr> </Tile>
</thead> </Tiles>
<tbody>
<tr v-for="(item, index) in playlists" :key="item.id">
<td>
<router-link :to="{name: 'playlist', params: { id: item.id } }">
{{ item.name }}
</router-link>
</td>
<td>{{ item.created | dateTime }}</td>
<td>{{ item.changed | dateTime }}</td>
<td class="text-right">
<OverflowMenu>
<b-dropdown-item-btn @click="deletePlaylist(item.id)">Delete</b-dropdown-item-btn>
</OverflowMenu>
</td>
</tr>
</tbody>
</b-table-simple>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";

View File

@ -139,6 +139,7 @@ export class API {
return response.playlists.playlist.map((playlist: any) => ({ return response.playlists.playlist.map((playlist: any) => ({
...playlist, ...playlist,
name: playlist.name || "(Unnamed)", name: playlist.name || "(Unnamed)",
image: playlist.songCount > 0 ? this.getCoverArtUrl(playlist) : undefined,
})); }));
} }