Add images to playlists
This commit is contained in:
parent
ef2d1a5704
commit
7ea3f3b5fe
2 changed files with 16 additions and 1 deletions
|
@ -14,16 +14,20 @@
|
||||||
<caption><a href="{{ $playlist.external_urls.spotify }}">View playlist on Spotify</a></caption>
|
<caption><a href="{{ $playlist.external_urls.spotify }}">View playlist on Spotify</a></caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th scope="row"></th>
|
||||||
<th scope="row">Track</th>
|
<th scope="row">Track</th>
|
||||||
<th scope="row">Artist</th>
|
<th scope="row">Artist</th>
|
||||||
<th scope="row">Album</th>
|
<th scope="row">Album</th>
|
||||||
<th scope="row"></th>
|
<th scope="row">Preview</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{ range sort $playlist.tracks.items "track.name" }}
|
{{ range sort $playlist.tracks.items "track.name" }}
|
||||||
{{ with .track }}
|
{{ with .track }}
|
||||||
<tr>
|
<tr>
|
||||||
|
{{ with index (last 1 .album.images) 0 }}
|
||||||
|
<td><div class="image" data-image="{{ .url }}"></div></td>
|
||||||
|
{{ end }}
|
||||||
<td><a href="{{ .external_urls.spotify }}">{{ .name }}</a></td>
|
<td><a href="{{ .external_urls.spotify }}">{{ .name }}</a></td>
|
||||||
<td>
|
<td>
|
||||||
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}
|
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}
|
||||||
|
|
|
@ -234,3 +234,14 @@ p code, li code {
|
||||||
color: $black;
|
color: $black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.playlist {
|
||||||
|
.image {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td, td > * {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue