Simplify spotify rendering and add preview link
This commit is contained in:
parent
9a5b16934d
commit
5b46a7e442
1 changed files with 12 additions and 3 deletions
|
@ -18,6 +18,7 @@
|
|||
<table class="table table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"></th>
|
||||
<th scope="row">Track</th>
|
||||
<th scope="row">Artist</th>
|
||||
|
@ -27,11 +28,19 @@
|
|||
<tbody>
|
||||
{{ range sort $playlist.tracks.items "track.name" }}
|
||||
{{ with .track }}
|
||||
{{ $spotify_url := .external_urls.spotify }}
|
||||
<tr>
|
||||
{{ with index (last 1 .album.images) 0 }}
|
||||
<td><div class="image" data-image="{{ .url }}"></div></td>
|
||||
{{ with index .album.images 0 }}
|
||||
<td>
|
||||
<a href="{{ $spotify_url }}"><div class="image" data-image="{{ .url }}"></div></a>
|
||||
</td>
|
||||
{{ end }}
|
||||
<td><a href="{{ .external_urls.spotify }}">{{ .name }}</a></td>
|
||||
<td class="text-center">
|
||||
{{ if .preview_url }}
|
||||
<a href="{{ .preview_url }}"><i class="fas fa-play"></i></a>
|
||||
{{ end }}
|
||||
</td>
|
||||
<td><a href="{{ $spotify_url }}">{{ .name }}</a></td>
|
||||
<td>
|
||||
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}
|
||||
</td>
|
||||
|
|
Loading…
Reference in a new issue