diff --git a/static/nryg.less b/static/nryg.less index f33eb704..54e143da 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -49,25 +49,51 @@ textarea { height: 300px; } -button, input[type="submit"] { +button, input[type="submit"], .button { background-color: rgba(red(@text-color), green(@text-color), blue(@text-color), 0.1); border-radius: 0; border: 1px solid @text-color; - color: @text-color; + color: @text-color !important; padding: 2px; padding-left: 8px; padding-right: 8px; margin: 1px; font-size: medium; font-family: sans-serif; + text-decoration: none; + cursor: default; } -button:hover, input[type="submit"]:hover { +button:hover, input[type="submit"]:hover, .button:hover { background-color: rgba(red(@text-color), green(@text-color), blue(@text-color), 0.3); - color: @accent-color; border: 1px solid @accent-color; } +button:active, input[type="submit"]:active, .button:active { + background-color: rgba(red(@text-color), green(@text-color), blue(@text-color), 0.5); + color: @accent-color !important; + border: 1px solid @accent-color; + +} + +nav { + border-bottom: 1px solid rgba(red(@text-color), green(@text-color), blue(@text-color), 0.1); + padding: 8px; + display: grid; + + .left + { + grid-column: 1; + text-align: left; + } + + .right + { + grid-column: 2; + text-align: right; + } +} + .input-grid { display: grid; diff --git a/templates/base.html b/templates/base.html index 90d64c61..f2f0c112 100644 --- a/templates/base.html +++ b/templates/base.html @@ -10,6 +10,22 @@ {% block posthead %}{% endblock %} + {% block body %}{% endblock %} \ No newline at end of file diff --git a/webserver.py b/webserver.py index c27a88d7..b2005558 100644 --- a/webserver.py +++ b/webserver.py @@ -66,15 +66,25 @@ def page_loggedin(): return if user.password is None: fl_session["user_id"] = user.id + fl_session["username"] = username return redirect(url_for("page_password")) if bcrypt.checkpw(bytes(password, encoding="utf8"), user.password): fl_session["user_id"] = user.id + fl_session["username"] = username return redirect(url_for("page_main")) else: abort(401) return +@app.route("/logout") +def page_logout(): + if "user_id" in fl_session: + del fl_session["user_id"] + del fl_session["username"] + return redirect(url_for("page_main")) + + @app.route("/password", methods=["GET", "POST"]) def page_password(): user_id = fl_session.get("user_id")