mirror of
https://github.com/Project-Redacted/Highscores-Server.git
synced 2025-05-29 22:43:13 +00:00
Add account page and login system
This commit is contained in:
parent
ebdef07840
commit
ffba2b3b7b
11 changed files with 154 additions and 63 deletions
5
server/templates/about.html
Normal file
5
server/templates/about.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h2>What is The Front Rooms?</h2>
|
||||
<h2>Project Redacted</h2>
|
||||
{% endblock %}
|
10
server/templates/account.html
Normal file
10
server/templates/account.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h2>Hello, {{ current_user.username }}!</h2>
|
||||
<a href="{{ url_for('auth.logout') }}">Logout</a>
|
||||
|
||||
<h2>Tokens</h2>
|
||||
{% for token in token_list %}
|
||||
<p>{{ token.token }}</p>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
|
@ -2,21 +2,19 @@
|
|||
{% block content %}
|
||||
<div class="auth">
|
||||
<h2>Login</h2>
|
||||
<form action="" method="POST">
|
||||
<input type="text" name="username" placeholder="Username | Email" required>
|
||||
<form action="{{ url_for('auth.login') }}" method="POST">
|
||||
<input type="text" name="username" placeholder="Username" required>
|
||||
<input type="password" name="password" placeholder="Password" required>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p style="text-align: center;">or</p>
|
||||
|
||||
<div class="auth">
|
||||
<h2>Register</h2>
|
||||
<form action="{{ url_for('auth.register') }}" method="POST">
|
||||
<input type="text" name="username" placeholder="Username" required>
|
||||
<input type="password" name="password" placeholder="Password" required>
|
||||
<button type="submit" class="secondary">Register</button>
|
||||
<button type="submit">Register</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -5,30 +5,33 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Front Rooms Highscores</title>
|
||||
<script src="https://unpkg.com/@phosphor-icons/web"></script>
|
||||
{% assets "styles" %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css">
|
||||
{% endassets %}
|
||||
</head>
|
||||
<body>
|
||||
<img src="{{ url_for("static", filename="bg.png") }}" alt="The Front Rooms pause menu" class="background">
|
||||
<img src="{{ url_for('static', filename='bg.png') }}" alt="The Front Rooms pause menu" class="background">
|
||||
<div class="app">
|
||||
<header>
|
||||
<img src="{{ url_for("static", filename="title.png") }}" alt="The Front Rooms logo" class="title" height="60px">
|
||||
<img src="{{ url_for('static', filename='title.png') }}" alt="The Front Rooms logo" class="title" height="60px">
|
||||
<nav>
|
||||
<a href="{{ url_for('views.index', diff=0) }}" class="button">Level 1</a>
|
||||
<a href="{{ url_for('views.index', diff=1) }}" class="button">Level 2</a>
|
||||
<a href="{{ url_for('views.index', diff=2) }}" class="button">Level 3</a>
|
||||
<a href="{{ url_for('views.index', diff=3) }}" class="button">Normal</a>
|
||||
<a href="{{ url_for('views.index', diff=4) }}" class="button">Hard</a>
|
||||
<a href="{{ url_for('views.index') }}" class="button"><i class="ph ph-house"></i></a>
|
||||
<a href="{{ url_for('views.about') }}" class="button"><i class="ph ph-info"></i></a>
|
||||
<a href="#" class="button"><i class="ph ph-download-simple"></i></a>
|
||||
|
||||
<span></span> <!-- This is a spacer -->
|
||||
<!-- This is a spacer -->
|
||||
<span></span>
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
<a href="{{ url_for('auth.account') }}" class="button secondary">Account</a>
|
||||
<a href="{{ url_for('auth.account') }}" class="button primary">{{ current_user.username }}</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('auth.auth') }}" class="button secondary">Login</a>
|
||||
<a href="{{ url_for('auth.auth') }}" class="button primary"><i class="ph ph-identification-card"></i></a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
<!-- Secondary nav bar for page specific content -->
|
||||
{% block nav %}{% endblock %}
|
||||
</header>
|
||||
|
||||
<!-- This is where the flash messages will be displayed -->
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
{% extends "base.html" %}
|
||||
{% block nav %}
|
||||
<nav>
|
||||
<a href="{{ url_for('views.index', diff=0) }}" class="button">Level 1</a>
|
||||
<a href="{{ url_for('views.index', diff=1) }}" class="button">Level 2</a>
|
||||
<a href="{{ url_for('views.index', diff=2) }}" class="button">Level 3</a>
|
||||
<a href="{{ url_for('views.index', diff=3) }}" class="button">Normal</a>
|
||||
<a href="{{ url_for('views.index', diff=4) }}" class="button">Hard</a>
|
||||
|
||||
<!-- This is a spacer -->
|
||||
<span></span>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% if scores %}
|
||||
<table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue