mirror of
https://github.com/csd4ni3l/grass_touching_captcha.git
synced 2026-01-01 12:33:45 +01:00
make the pages global and add navbar to each of them and dont require authentication, also add logout button
This commit is contained in:
17
main.py
17
main.py
@@ -131,17 +131,15 @@ def submit_challenge():
|
|||||||
|
|
||||||
return Response(f"/uploads/{image_uuid}.{image_type}", 200)
|
return Response(f"/uploads/{image_uuid}.{image_type}", 200)
|
||||||
|
|
||||||
@app.route("/app")
|
@app.route("/")
|
||||||
@flask_login.login_required
|
|
||||||
def application():
|
def application():
|
||||||
username = flask_login.current_user.id
|
username = flask_login.current_user.id if hasattr(flask_login.current_user, "id") else ""
|
||||||
|
|
||||||
return render_template("app.jinja2", username=username)
|
return render_template("home.jinja2", username=username)
|
||||||
|
|
||||||
@app.route("/leaderboard")
|
@app.route("/leaderboard")
|
||||||
@flask_login.login_required
|
|
||||||
def leaderboard():
|
def leaderboard():
|
||||||
username = flask_login.current_user.id
|
username = flask_login.current_user.id if hasattr(flask_login.current_user, "id") else ""
|
||||||
|
|
||||||
cur = get_db().cursor()
|
cur = get_db().cursor()
|
||||||
|
|
||||||
@@ -225,13 +223,6 @@ def uploads(filename):
|
|||||||
def info():
|
def info():
|
||||||
return redirect(RICKROLL_LINK)
|
return redirect(RICKROLL_LINK)
|
||||||
|
|
||||||
@app.route("/")
|
|
||||||
def main():
|
|
||||||
if flask_login.current_user.is_authenticated:
|
|
||||||
return redirect(url_for("application"))
|
|
||||||
else:
|
|
||||||
return redirect(url_for("login"))
|
|
||||||
|
|
||||||
@app.route('/logout')
|
@app.route('/logout')
|
||||||
def logout():
|
def logout():
|
||||||
flask_login.logout_user()
|
flask_login.logout_user()
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
{% extends "base.jinja2" %}
|
|
||||||
{% block title %}Grass Touching Dashboard{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
||||||
<div class="container-fluid d-flex justify-content-center">
|
|
||||||
<a class="navbar-brand" href="#">Grass Touching Captcha</a>
|
|
||||||
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/info">Information</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/leaderboard">Leaderboard</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="d-flex justify-content-center align-items-center vh-100 bg-dark">
|
|
||||||
<div class="d-flex flex-column justify-content-center text-white text-center" style="transform: translateY(-25%);">
|
|
||||||
<h1>Welcome back, {{ username }}</h1>
|
|
||||||
<h5>Why are you here?</h5>
|
|
||||||
<h5>Why did you cheat?</h5>
|
|
||||||
<h5>I know you did!!!</h5>
|
|
||||||
<h5>No one touches grass!</h5>
|
|
||||||
<h5>I know you don't go outside you liar!</h5>
|
|
||||||
<h5>You are a discord moderator who plays League of Legends 24 hours a day!</h5>
|
|
||||||
<h5>But, if you really want to learn how to go outside and touch grass, check our <a href="/info">unofficial guide</a></h5>
|
|
||||||
<h5>To prove you belong here, you have to touch grass each day or your account will be permanently banned with no exceptions.</h5>
|
|
||||||
<h5>To see how you fare against others, check the <a href="/leaderboard">leaderboard</a></h5>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
66
templates/home.jinja2
Normal file
66
templates/home.jinja2
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{% extends "base.jinja2" %}
|
||||||
|
{% block title %}Grass Touching Dashboard{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||||
|
<div class="container-fluid d-flex justify-content-center">
|
||||||
|
<a class="navbar-brand" href="#">Grass Touching Captcha</a>
|
||||||
|
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/info">Information</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/leaderboard">Leaderboard</a>
|
||||||
|
</li>
|
||||||
|
{% if not current_username %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/register">Register</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/login">Login</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/logout">Logout</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-center align-items-center vh-100 bg-dark">
|
||||||
|
<div class="d-flex flex-column justify-content-center text-white text-center" style="transform: translateY(-25%);">
|
||||||
|
{% if username %}
|
||||||
|
<h1>Welcome back, {{ username }}</h1>
|
||||||
|
<h5>Why are you here?</h5>
|
||||||
|
<h5>Why did you cheat?</h5>
|
||||||
|
<h5>I know you did!!!</h5>
|
||||||
|
<h5>No one touches grass!</h5>
|
||||||
|
<h5>I know you don't go outside you liar!</h5>
|
||||||
|
<h5>You are a discord moderator who plays League of Legends 24 hours a day!</h5>
|
||||||
|
<h5>But, if you really want to learn how to go outside and touch grass, check our <a href="/info">unofficial guide</a></h5>
|
||||||
|
<h5>To prove you belong here, you have to touch grass each day or your account will be permanently banned with no exceptions.</h5>
|
||||||
|
<h5>To see how you fare against others, check the <a href="/leaderboard">leaderboard</a></h5>
|
||||||
|
{% else %}
|
||||||
|
<h1>Welcome anonymous discord moderator on the internet!</h1>
|
||||||
|
<h5>Why are you here?</h5>
|
||||||
|
<h5>You should go outside and touch grass instead.</h5>
|
||||||
|
<h5>Even though i know you won't, if you want to learn how to go outside and touch grass, check our <a href="/info">unofficial guide</a></h5>
|
||||||
|
<h5>After watching the guide, you should <a href="/register">register</a> on our website!</h5>
|
||||||
|
<h5>To prove you belong here, you have to touch grass each day or your account will be permanently banned with no exceptions.</h5>
|
||||||
|
<h5>To see how you fare against others, check the <a href="/leaderboard">leaderboard</a></h5>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/app">Home</a>
|
<a class="nav-link" href="#">Home</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/info">Information</a>
|
<a class="nav-link" href="/info">Information</a>
|
||||||
@@ -21,10 +21,23 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" aria-current="page" href="/leaderboard">Leaderboard</a>
|
<a class="nav-link active" aria-current="page" href="/leaderboard">Leaderboard</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if not current_username %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/register">Register</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/login">Login</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/logout">Logout</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="d-flex justify-content-center align-items-center vh-100 bg-dark">
|
<div class="d-flex justify-content-center align-items-center vh-100 bg-dark">
|
||||||
<div class="card text-center shadow-lg" style="width: 400px;">
|
<div class="card text-center shadow-lg" style="width: 400px;">
|
||||||
<div class="card-header bg-primary text-white">
|
<div class="card-header bg-primary text-white">
|
||||||
|
|||||||
@@ -1,6 +1,35 @@
|
|||||||
{% extends "base.jinja2" %}
|
{% extends "base.jinja2" %}
|
||||||
{% block title %}Grass Touching Login{% endblock %}
|
{% block title %}Grass Touching Login{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||||
|
<div class="container-fluid d-flex justify-content-center">
|
||||||
|
<a class="navbar-brand" href="#">Grass Touching Captcha</a>
|
||||||
|
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Home</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/info">Information</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/leaderboard">Leaderboard</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/register">Register</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" aria-current="page" href="/login">Login</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<div class="d-flex justify-content-center align-items-center" style="height: 75vh;">
|
<div class="d-flex justify-content-center align-items-center" style="height: 75vh;">
|
||||||
<div class="bg-white rounded rounded-5 border border-5 border-white p-4">
|
<div class="bg-white rounded rounded-5 border border-5 border-white p-4">
|
||||||
|
|||||||
@@ -1,6 +1,35 @@
|
|||||||
{% extends "base.jinja2" %}
|
{% extends "base.jinja2" %}
|
||||||
{% block title %}Grass Touching Register{% endblock %}
|
{% block title %}Grass Touching Register{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||||
|
<div class="container-fluid d-flex justify-content-center">
|
||||||
|
<a class="navbar-brand" href="#">Grass Touching Captcha</a>
|
||||||
|
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Home</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/info">Information</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/leaderboard">Leaderboard</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" aria-current="page" href="/register">Register</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/login">Login</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<div class="d-flex justify-content-center align-items-center" style="height: 75vh;">
|
<div class="d-flex justify-content-center align-items-center" style="height: 75vh;">
|
||||||
<div class="bg-white rounded rounded-5 border border-5 border-white p-4">
|
<div class="bg-white rounded rounded-5 border border-5 border-white p-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user