From: Chris Fulljames Date: Sun, 23 Feb 2025 13:33:05 +0000 (-0500) Subject: Use icons in more places, revamp song page X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=3aadb815b49e8272a9f5bc5106bcbe876fa5dfc7;p=littlesongplace.git Use icons in more places, revamp song page --- diff --git a/main.py b/main.py index 5e81a87..5210658 100644 --- a/main.py +++ b/main.py @@ -287,10 +287,11 @@ def upload_song(): if not "userid" in session: return redirect("/login") # Must be logged in to edit + userid = session["userid"] + error = validate_song_form() if not error: - userid = session["userid"] if "songid" in request.args: error = update_song() else: @@ -299,7 +300,12 @@ def upload_song(): if not error: username = session["username"] app.logger.info(f"{username} uploaded/modified a song") - return redirect(f"/users/{username}") + if "songid" in request.args: + # After editing an existing song, go back to song page + return redirect(f"/song/{userid}/{request.args['songid']}?action=view") + else: + # After creating a new song, go back to profile + return redirect(f"/users/{username}") else: username = session["username"] @@ -525,7 +531,7 @@ def delete_song(songid): app.logger.info(f"{session['username']} deleted song: {song_data['title']}") flash_and_log(f"Deleted '{song_data['title']}'", "success") - return redirect(request.referrer) + return redirect(f"/users/{session['username']}") @app.get("/song//") def song(userid, songid): diff --git a/static/lsp_btn_add02.gif b/static/lsp_btn_add02.gif new file mode 100644 index 0000000..38ec190 Binary files /dev/null and b/static/lsp_btn_add02.gif differ diff --git a/static/styles.css b/static/styles.css index c79f8c6..f539dbb 100644 --- a/static/styles.css +++ b/static/styles.css @@ -304,7 +304,7 @@ div.song-list { gap: 10px; } -div.song { +.song-list .song { box-shadow: 0px 0px 5px 0px; border-radius: 10px; } @@ -372,6 +372,9 @@ div.song-details { flex-direction: column; gap: 15px; align-items: left; +} + +.song .song-details { margin: 10px; } diff --git a/templates/playlist.html b/templates/playlist.html index e0aed63..20ec143 100644 --- a/templates/playlist.html +++ b/templates/playlist.html @@ -22,8 +22,8 @@ Playlist by {{ username }}< {% if session["userid"] == userid -%}

- -Delete + +