diff --git a/static/nryg.less b/static/nryg.less index 357aca5c..a20c94a7 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -71,7 +71,7 @@ code { font-family: "Consolas", "Source Code Pro", monospace; } -input[type="text"], input[type="password"] { +input[type="text"], input[type="password"], input[type="email"] { background-color: rgba(red(@text-color), green(@text-color), blue(@text-color), 0.1); color: @text-color; border: none; diff --git a/templates/profileedit.html b/templates/profileedit.html index 898cbe8d..2b87044c 100644 --- a/templates/profileedit.html +++ b/templates/profileedit.html @@ -9,6 +9,7 @@ Modifica profilo
+
Puoi usare il Markdown nella tua bio. Se vuoi, puoi personalizzare il tuo profilo con un tuo foglio di stile! diff --git a/webserver.py b/webserver.py index 931f126e..e39f3294 100644 --- a/webserver.py +++ b/webserver.py @@ -194,33 +194,26 @@ def page_password(): @app.route("/editprofile", methods=["GET", "POST"]) @require_login def page_editprofile(): - profile_data = fl_g.session.query(db.ProfileData).filter_by(royal_id=fl_g.user.id).join(db.Royal).one_or_none() + royal = fl_g.session.query(db.Royal).filter_by(id=fl_g.user.id).one() + profile_data = fl_g.session.query(db.ProfileData).filter_by(royal=royal).one_or_none() if request.method == "GET": - return render_template("profileedit.html", data=profile_data) + return render_template("profileedit.html", royal=royal, data=profile_data) elif request.method == "POST": css = request.form.get("css", "") bio = request.form.get("bio", "") + email = request.form.get("email") if "configurato la sua bio' - f' su Royalnet e ha ottenuto un fioryg!', - parse_mode="HTML", disable_web_page_preview=True, disable_notification=True) - except Exception: - pass else: profile_data.css = css profile_data.bio = bio fl_g.session.commit() - royal = fl_g.session.query(db.Royal).filter_by(id=fl_g.user.id).one() return redirect(url_for("page_profile", name=royal.username))