Yeet useless tables

Yeet useless data paths in dockerfile
Add order into templates file
This commit is contained in:
Michał Gdula 2023-06-22 13:19:00 +00:00
parent b19dedc568
commit 300c80fcd5
17 changed files with 86 additions and 106 deletions

View file

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block content %}
<h2>What is The Front Rooms?</h2>
<p>The Front Rooms is a game based on The Backrooms Genre of games.</p>
<h2>Is my data secured?</h2>
<p>Yes, all passwords and emails are hashed and salted, and at no point stored in plain text.</p>
{% endblock %}

View file

@ -0,0 +1,25 @@
{% extends "base.html" %}
{% from "macros/input.html" import text %}
{% block content %}
<div class="block">
<h2>Login</h2>
<p>Welcome back!</p>
<form action="{{ url_for('auth.login') }}" method="POST">
{{ text(id="login-username", name="username", required=True) }}
{{ text(id="login-password", name="password", type="password", required=True) }}
<button type="submit" class="button primary">Login</button>
</form>
</div>
<div class="block">
<h2>Register</h2>
<p>Don't have an account?</p>
<form action="{{ url_for('auth.register') }}" method="POST">
{{ text(id="register-username", name="username", required=True) }}
{{ text(id="register-password", name="password", type="password", required=True, minlength=8) }}
{{ text(id="register-confirm", name="confirm", type="password", required=True, minlength=8) }}
<button type="submit" class="button primary">Register</button>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,74 @@
{% extends "base.html" %}
{% block nav %}
<hr>
<nav>
<form method="GET" action="{{ url_for('views.index') }}" class="compact">
<select name="diff" class="button">
<option value="0" {% if diff==0 %}selected{% endif %}>Level 1</option>
<option value="1" {% if diff==1 %}selected{% endif %}>Level 2</option>
<option value="2" {% if diff==2 %}selected{% endif %}>Level 3</option>
<option value="3" {% if diff==3 %}selected{% endif %}>Normal</option>
<option value="4" {% if diff==4 %}selected{% endif %}>Hard</option>
</select>
<select name="ver" class="button">
{% for game_version in config["GAME_VERSIONS"] %}
<option
value="{{ game_version }}"
{% if ver==game_version %}selected{% endif %}
>{{ game_version }}</option>
{% endfor %}
</select>
<span class="text-input">
<label for="search">Username</label>
<input type="text" name="user" id="search" {% if user %}value="{{ user }}"{% endif %} autocomplete="off"/>
</span>
<button class="button"><i class="ph ph-magnifying-glass"></i></button>
</form>
</nav>
{% endblock %}
{% block content %}
{% if scores %}
<div class="table">
<table>
<tr>
<th></th>
<th>Name</th>
<th>Time Set</th>
<th>Submitted</th>
<!-- <th>Game</th> -->
</tr>
{% for score in scores %}
<tr>
{% if loop.index == 1 %}
<td><i class="first ph-fill ph-crown"></i></td>
{% elif loop.index == 2 %}
<td><i class="second ph-duotone ph-crown"></i></td>
{% elif loop.index == 3 %}
<td><i class="third ph ph-crown"></i></td>
{% else %}
<td>{{ loop.index }}</td>
{% endif %}
{% if score.users.id == current_user.id %}
<td class="player">{{ score.users.username }}</td>
{% else %}
<td>{{ score.users.username }}</td>
{% endif %}
<td>{{ score.score | format_result }}</td>
<td>{{ score.scored_at.strftime('%Y-%m-%d') }}</td>
<!-- <td>{{ score.version }}</td> -->
</tr>
{% endfor %}
</table>
</div>
{% else %}
<div class="center-text">
<h2>No scores</h2>
<p>Go set some!</p>
</div>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,54 @@
{% extends "base.html" %}
{% block content %}
{% if not current_user.email %}
<div class="block secondary">
<h2>No Email set</h2>
<p>If you forget your password, you will not be able to recover your account.</p>
</div>
{% endif %}
<div class="block">
<h2>Hello, {{ current_user.username }}!</h2>
<p>Sample text</p>
</div>
<div class="block">
<h2>Sessions</h2>
<p>Devices and games that you logged into. If you're looking to logout all website users, reset your password instead.</p>
<div class="table">
<table>
<tr>
<th></th>
<th>Device</th>
<th>Created</th>
<th>Last Used</th>
</tr>
{% if sessions %}
{% for session in sessions %}
<tr id="sess-{{ session.id }}">
<td><button onclick="yeetSession({{ session.id }})" class="button secondary"><i class="ph ph-trash"></i></button></td>
<td>{{ session.device_type }}</td>
<td>{{ session.created_at.strftime('%Y-%m-%d') }}</td>
<td>{{ session.last_used.strftime('%Y-%m-%d') }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
{% endif %}
</table>
</div>
</div>
<div class="block secondary">
<h2>Danger Zone</h2>
<p>Be careful!</p>
<a href="{{ url_for('views.settings', action='delete') }}" class="button secondary" style="margin-bottom: 0.5rem">Delete Account</a>
<a href="{{ url_for('views.settings', action='password') }}" class="button secondary" style="margin-bottom: 0.5rem">Reset Password</a>
<a href="{{ url_for('views.settings', action='logout') }}" class="button secondary">Logout</a>
</div>
{% endblock %}