diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-14 00:45:42 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-14 00:57:04 -0400 |
| commit | 060b315f74f437fe36175c4ddb52379d29808d64 (patch) | |
| tree | f3e0bd83433f3d918927771e60a9369fbcc320a2 /templates/index.tmpl | |
| parent | 2e190b1af96b0836684339bfb4353a17cf28f0b9 (diff) | |
| download | lastfm-api-060b315f74f437fe36175c4ddb52379d29808d64.tar.gz | |
Now Playing feature
Diffstat (limited to 'templates/index.tmpl')
| -rw-r--r-- | templates/index.tmpl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/templates/index.tmpl b/templates/index.tmpl index 2451c6b..1ab1726 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -1,21 +1,26 @@ {{template "header" . }} <h2>Recent Listens</h2> <ul class="scrobbles"> + {{if .NowPlaying}} {{template "song" .NowPlaying}} {{end}} {{- range .Scrobbles}} + {{template "song" .}} +{{- end}} +</ul> +{{template "footer" }} + +{{define "song"}} <li> - <img src="{{or .Image "https://lastfm-img2.akamaized.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.png"}}"/> + <img class="cover" src="{{or .Image "https://lastfm-img2.akamaized.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.png"}}"/> <div> {{.Artist}} — {{.TrackName}}<br/> <span class="album">in {{.Album}}</span> </div> <div class="like"> - <span class="album">{{ago .Time}}</span><br/> + <span class="time">{{.Time | ago}}</span><br/> <span class="swap"> <i class="material-icons one">favorite_border</i> <i class="material-icons two">favorite</i> </span> </div> </li> -{{- end}} -</ul> -{{template "footer" }} +{{end}} |
