From 5e583ff30f313aa394cfb8bb5b8023de38dbeea8 Mon Sep 17 00:00:00 2001 From: boulosQ24-meet Date: Mon, 31 Jul 2023 16:43:00 +0300 Subject: [PATCH] semi final update --- app.py | 7 +-- static/style.css | 90 +++++++++++++++++++++++++++++++++---- templates/comments.html | 21 +++++++-- templates/scholarships.html | 2 +- templates/studentlife.html | 4 -- 5 files changed, 105 insertions(+), 19 deletions(-) diff --git a/app.py b/app.py index f74350e..2e5507c 100644 --- a/app.py +++ b/app.py @@ -68,11 +68,12 @@ def comments(): text = request.form['comment'] comment = {"username": name,"email": email, "comment": text} db.child("Comments").push(comment) - x = db.child("Comments").get().val() - return render_template('comments.html',comments=x) + comments = db.child("Comments").get().val() + return render_template('comments.html', comments = comments) except: error = "error" - return render_template('comments.html') + comments = db.child("Comments").get().val() + return render_template('comments.html', comments=comments) @app.route('/contact', methods=['GET', 'POST']) def contact(): return render_template('contact.html') diff --git a/static/style.css b/static/style.css index abb4ef6..c9c4316 100644 --- a/static/style.css +++ b/static/style.css @@ -1561,11 +1561,85 @@ section { text-decoration: none; } -.form{ - margin-left: 37%; - border: 5px solid #5fcf80; - background-color: #5fcf80; - border-radius: 50px; - width: 500px; - padding-top: 10px; -} \ No newline at end of file +.form { + width: 350px; + margin: 0 auto; + font-family: Arial, sans-serif; + background-color: #f7f7f7; + padding: 20px; + border-radius: 5px; + box-shadow: 5px 5px 5px rgba(0.1, 0.1, 0.1, 0.1); +} + +.username, +.email, +.textarea { + width: 100%; + padding: 10px; + border: 1px solid #ccc; + border-radius: 3px; + font-size: 16px; + margin-bottom: 15px; +} + +.username::placeholder, +.email::placeholder, +.textarea::placeholder { + color: #999; +} + +input[type="submit"] { + width: 100%; + padding: 10px; + font-size: 16px; + background-color: #4caf50; + color: white; + border: none; + border-radius: 3px; + cursor: pointer; +} + +input[type="submit"]:hover { + background-color: #45a049; +} + +.form { + text-align: center; +} + +/* Styles for the comment section container */ +.comments { + width: 100%; + margin: 0 auto; + font-family: Arial, sans-serif; + background-color: #f7f7f7; + padding: 20px; + border-radius: 5px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +/* Styles for each comment */ +.comment-place { + margin-bottom: 20px; + background-color: #ffffff; /* Light background color for each comment */ + padding: 10px; + border-radius: 5px; +} + +.comment-place p { + font-size: 16px; + line-height: 1.5; +} + +/* Username styles */ +.comment-place .username { + font-size: 18px; + font-weight: bold; + color: #007bff; /* Or any other color of your choice */ + margin-bottom: 5px; +} + +/* Center the comments */ +.comments { + text-align: left; +} diff --git a/templates/comments.html b/templates/comments.html index 6fadfa1..e9ccde7 100644 --- a/templates/comments.html +++ b/templates/comments.html @@ -58,18 +58,33 @@

Mentor



- +

- +

- +



+ +
+

Comments:

+ +
+ {%for i in comments%} +
+
Name: {{comments[i]['username']}}
+ +
+ +
Comment: {{comments[i]['comment']}}
+
+ {%endfor%} +
\ No newline at end of file diff --git a/templates/scholarships.html b/templates/scholarships.html index 19ca382..0453834 100644 --- a/templates/scholarships.html +++ b/templates/scholarships.html @@ -88,7 +88,7 @@

Mentor



- +

diff --git a/templates/studentlife.html b/templates/studentlife.html index 932af79..129fd3d 100644 --- a/templates/studentlife.html +++ b/templates/studentlife.html @@ -82,10 +82,6 @@

Mentor












- {%for i in comments%} - {{comments[i]['username']}}
- {{comments[i]['comment']}} - {%endfor%}