{{ define "user" }}
stats
artists: {{ .ArtistCount }}
albums: {{ .AlbumCount }}
tracks: {{ .TrackCount }}
last.fm

have gonic scrobble to last.fm on your behalf

{{ if .User.IsAdmin }}
update api key…
{{ end }} {{ if .CurrentLastFMAPIKey }}
current status {{ if .User.LastFMSession }} linked | unlink
{{ else }} unlinked {{ $cbPath := path "/admin/link_lastfm_do" }} {{ $cbURL := printf "%s%s" .RequestRoot $cbPath }} link
{{ end }} {{ else if not .User.IsAdmin }}

api key not set

please ask your admin to set it

{{ end }}
{{ if .User.IsAdmin }} {{/* admin panel to manage all users */}}
users
{{ range $user := .AllUsers }} {{ $user.Name }} {{ $user.CreatedAt | date }} | change password… | {{ if $user.IsAdmin }} delete… {{ else }} delete… {{ end }}
{{ end }}
create new…
{{ else }} {{/* user panel to manage themselves */}}
your account
change password…
{{ end }}
recent folders
{{ if eq (len .RecentFolders) 0 }} no folders yet {{ end }} {{ range $folder := .RecentFolders }} {{ end }}
{{ $folder.RightPath }} {{ $folder.ModifiedAt | dateHuman }}
{{- if not .IsScanning -}} start scan {{- if not .LastScanTime.IsZero -}}
scanned {{ .LastScanTime | dateHuman }} {{ end }} {{ end }}
playlists
{{ if eq (len .Playlists) 0 }} no playlists yet {{ end }} {{ range $playlist := .Playlists }} {{ end }}
{{ $playlist.Name }} ({{ $playlist.TrackCount }} tracks) {{ $playlist.CreatedAt | dateHuman }}

{{ end }}