1
Fork 0

Add images to playlists

This commit is contained in:
Jake Howard 2018-01-20 11:56:31 +00:00
parent ef2d1a5704
commit 7ea3f3b5fe
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 16 additions and 1 deletions

View file

@ -14,16 +14,20 @@
<caption><a href="{{ $playlist.external_urls.spotify }}">View playlist on Spotify</a></caption>
<thead>
<tr>
<th scope="row"></th>
<th scope="row">Track</th>
<th scope="row">Artist</th>
<th scope="row">Album</th>
<th scope="row"></th>
<th scope="row">Preview</th>
</tr>
</thead>
<tbody>
{{ range sort $playlist.tracks.items "track.name" }}
{{ with .track }}
<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>
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}

View file

@ -234,3 +234,14 @@ p code, li code {
color: $black;
}
}
.playlist {
.image {
width: 50px;
height: 50px;
}
td, td > * {
vertical-align: middle;
}
}