From: Chris Fulljames Date: Sun, 16 Feb 2025 13:40:20 +0000 (-0500) Subject: Add playlist type to UI, add song instructions X-Git-Url: https://littlesong.place/gitweb/gitweb.cgi?a=commitdiff_plain;h=c06cfa6b9c101c1f91d323d5e82df2363c9cd45f;p=littlesongplace.git Add playlist type to UI, add song instructions --- diff --git a/main.py b/main.py index 86987b2..93e5c52 100644 --- a/main.py +++ b/main.py @@ -157,9 +157,9 @@ def users_profile(profile_username): userid = session.get("userid", None) show_private = userid == profile_userid if show_private: - plist_data = query_db("select * from playlists where userid = ?", [profile_userid]) + plist_data = query_db("select * from playlists where userid = ? order by created desc", [profile_userid]) else: - plist_data = query_db("select * from playlists where userid = ? and private = 0", [profile_userid]) + plist_data = query_db("select * from playlists where userid = ? and private = 0 order by created desc", [profile_userid]) # Get songs for current profile songs = Song.get_all_for_userid(profile_userid) diff --git a/static/styles.css b/static/styles.css index 54aeb80..bf0eef1 100644 --- a/static/styles.css +++ b/static/styles.css @@ -228,6 +228,10 @@ input[type=file] { margin: 10px 0px; } +.playlist-type { + opacity: 50%; +} + .draggable-song { box-shadow: 0px 0px 5px 0px; border-radius: 10px; diff --git a/templates/playlist.html b/templates/playlist.html index 15e2d6e..2a8088d 100644 --- a/templates/playlist.html +++ b/templates/playlist.html @@ -6,7 +6,14 @@

{{ name }}

-

Playlist by {{ username }}

+

+Playlist by {{ username }} +{% if session["userid"] == userid -%} + +[{% if private %}Private{% else %}Public{% endif %}] + +{%- endif %} +

{% if session["userid"] == userid -%}

@@ -141,4 +148,8 @@ function deletePlaylist() { {%- endif %} +{% if not songs -%} +

This playlist doesn't have any songs yet. To add songs to the playlist, expand song details and use the "Add to Playlist..." dropdown.

+{%- endif %} + {%- endblock %} diff --git a/templates/profile.html b/templates/profile.html index f9ae7f5..0186d8b 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -165,6 +165,12 @@ {% for plist in playlists -%}
{{ plist['name'] }} + + {% if session["userid"] == userid -%} + + [{% if plist['private'] %}Private{% else %}Public{% endif %}] + + {%- endif %}
{%- endfor %}