From: Chris Fulljames Date: Sun, 16 Feb 2025 13:47:40 +0000 (-0500) Subject: Use user colors for songs and playlists X-Git-Url: https://littlesong.place/gitweb/gitweb.cgi?a=commitdiff_plain;h=0490763046d347cd7e4a1b1a5e98e14127cf6817;p=littlesongplace.git Use user colors for songs and playlists --- diff --git a/main.py b/main.py index 93e5c52..d848c8f 100644 --- a/main.py +++ b/main.py @@ -513,10 +513,15 @@ def song(userid, songid): song = Song.by_id(songid) if song.userid != userid: abort(404) - + + user_data = query_db("select * from users where userid = ?", [userid], one=True) return render_template( "song.html", - song_list=render_template("song-list.html", songs=[song]), song=song) + song_list=render_template("song-list.html", songs=[song]), + song=song, + user_bgcolor=user_data["bgcolor"], + user_fgcolor=user_data["fgcolor"], + user_accolor=user_data["accolor"]) except ValueError: abort(404) else: @@ -860,6 +865,9 @@ def playlists(playlistid): private=plist_data["private"], userid=plist_data["userid"], username=plist_data["username"], + user_bgcolor=plist_data["bgcolor"], + user_fgcolor=plist_data["fgcolor"], + user_accolor=plist_data["accolor"], songs=songs, song_list=render_template("song-list.html", songs=songs)) diff --git a/templates/playlist.html b/templates/playlist.html index 2a8088d..90ef05f 100644 --- a/templates/playlist.html +++ b/templates/playlist.html @@ -2,6 +2,20 @@ {% block title %}{{ name }}{% endblock %} +{% block head -%} + + + +{%- endblock %} + {% block body -%}

{{ name }}

diff --git a/templates/song.html b/templates/song.html index d993b91..65012ad 100644 --- a/templates/song.html +++ b/templates/song.html @@ -3,6 +3,15 @@ {% block head %} + {% endblock %} {% block title %}{{ song.title }}{% endblock %}