]> littlesong.place Git - littlesongplace.git/commitdiff
More design updates
authorChris Fulljames <christianfulljames@gmail.com>
Fri, 17 Jan 2025 02:10:35 +0000 (21:10 -0500)
committerChris Fulljames <christianfulljames@gmail.com>
Fri, 17 Jan 2025 02:10:35 +0000 (21:10 -0500)
main.py
static/styles.css
templates/edit-song.html
templates/login.html
templates/signup.html
todo.txt

diff --git a/main.py b/main.py
index aa2497f6eb7347e66fb68f482dfa5b7b4947b8d9..f9d6375d047ca4e24c471ac0fb3910e98c4533fa 100644 (file)
--- a/main.py
+++ b/main.py
@@ -110,7 +110,7 @@ def login_post():
         session["userid"] = user_data["userid"]
         session.permanent = True
         app.logger.info(f"{username} logged in")
-        return redirect("/")
+        return redirect(f"/users/{username}")
 
     flash("Invalid username/password", "error")
     app.logger.info(f"Failed login for {username}")
@@ -230,6 +230,7 @@ def upload_song():
         return redirect(f"/users/{username}")
 
     else:
+        username = session["username"]
         app.logger.info(f"Failed song update - {username} - {get_flashed_messages()}")
         return redirect(request.referrer)
 
@@ -249,10 +250,7 @@ def validate_song_form():
         error = True
 
     # Check if description is valid
-    if not description.isprintable():
-        flash(f"Description contains invalid characters", "error")
-        error = True
-    elif len(description) > 10_000:
+    if len(description) > 10_000:
         flash(f"Description cannot be more than 10k characters", "error")
         error = True
 
index a38b719037576efab6fbb63a68045784fd0368fb..f58e4657ed009f846caebc5e62a649cbea265a9a 100644 (file)
@@ -26,23 +26,38 @@ h2 {
 textarea {
     font-family: sans-serif;
     color: var(--purple);
-    border: 2px solid var(--blue);
+    border: 3px solid var(--purple);
     border-radius: 10px;
     padding: 10px;
     background: var(--yellow);
     height: 100px;
     width: 100%;
+    margin: 5px;
     box-sizing: border-box;
     resize: vertical;
 }
 
-.button {
+input[type=text], input[type=password] {
+    background: var(--yellow);
     font-family: sans-serif;
+    font-weight: bold;
+    color: var(--purple);
+    border: 3px solid var(--purple);
+    border-radius: 10px;
+    padding: 5px;
+    width: 200px;
+    margin: 5px;
+}
+
+.button, input[type=submit] {
+    font-family: sans-serif;
+    font-weight: bold;
     color: var(--yellow);
     background: var(--pink);
     border: 0px;
     border-radius: 5px;
     padding: 8px;
+    margin: 5px;
 }
 
 div.main {
@@ -79,6 +94,17 @@ div.navbar {
     padding: 10px;
 }
 
+/* Upload/Edit Form */
+
+div.upload-form input[type=text] {
+    width: 100%;
+    box-sizing: border-box;
+}
+
+input[type=file] {
+    margin: 5px;
+}
+
 /* Profile */
 .profile-name {
     text-align: center;
index e935e629f5b0db5c57a380ebecf1b899b6f0b6ed..7dfecec4c363746b47c11e9f5a30f0241559d3c4 100644 (file)
 {% endif %}
     <h2>Upload a new song</h2>
     <div class="upload-form">
-        <label for="song">{% if song %}Replace {% endif %}mp3 File</label>
+        <label for="song">{% if song %}Replace {% endif %}mp3 File</label><br>
         <input type="file" name="song" accept=".mp3" id="file-select" {% if not song %}required{% endif %}>
     </div>
     <div class="upload-form">
-        <label for="title">Title</label>
+        <label for="title">Title</label><br>
         <input type="text" name="title" id="song-title" value="{{ song.title }}" maxlength="80" required>
     </div>
     <div class="upload-form">
-        <label for="description">Description</label>
+        <label for="description">Description</label><br>
         <textarea name="description" maxlength="10000">{{ song.description }}</textarea>
     </div>
     <div class="upload-form">
-        <label for="tags">Tags</label>
+        <label for="tags">Tags</label><br>
         <input type="text" name="tags" placeholder="country, extratone, vocals, ..." value="{{ ", ".join(song.tags) }}" maxlength="350">
     </div>
     <div class="upload-form">
-        <label for="collabs">Collaborators</label>
+        <label for="collabs">Collaborators</label><br>
         <input type="text" name="collabs" placeholder="@fren_user, John Doe, ..." value="{{ ", ".join(song.collaborators) }}" maxlength="350">
     </div>
     <div class="upload-form">
index 9f65f99545be0fed0d1ee93e21a29c6047bbf2b0..40d095e89d4ab51b46b40a28830e05fc9034ed72 100644 (file)
 
 <form method="post" action="/login">
     <div class="login-form">
-        <label for="username">Username</label>
+        <label for="username">Username</label><br>
         <input type="text" name="username" maxlength="30" required></input>
     </div>
 
     <div class="login-form">
-        <label for="password">Password</label>
+        <label for="password">Password</label><br>
         <input type="password" name="password" maxlength="100" required></input>
     </div>
 
index 62bb675130f879216ef3719d2442d598ac33db98..3f6b3240b63e355da1932deb6b9f2e8f347a1323 100644 (file)
 </ol>
 <form method="post">
     <div class="signup-form">
-        <label for="username">Username</label>
+        <label for="username">Username</label><br>
         <input type="text" name="username" maxlength="30"required></input>
     </div>
 
     <div class="signup-form">
-        <label for="password">Password</label>
+        <label for="password">Password</label><br>
         <input type="password" name="password" maxlength="100" required></input>
     </div>
 
     <div class="signup-form">
-        <label for="password_confirm">Confirm Password</label>
+        <label for="password_confirm">Confirm Password</label><br>
         <input type="password" name="password_confirm" maxlength="100" required></input>
     </div>
 
index fcbdd2616426a6d0c71077266510a23a00dff6d6..62633a755e08d887eeff2e295255709dbc68c114 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -1,5 +1,5 @@
 TODO (BEFORE RELEASE)
-- CSS/Design
+- Multiline descriptions
 - Automated Tests
 - Homepage
 - Tips and Tricks