diff --git a/TFR/server/static/images/logo.png b/TFR/server/static/images/icon.png similarity index 100% rename from TFR/server/static/images/logo.png rename to TFR/server/static/images/icon.png diff --git a/TFR/server/static/js/flash.js b/TFR/server/static/js/flash.js new file mode 100644 index 0000000..b9807a6 --- /dev/null +++ b/TFR/server/static/js/flash.js @@ -0,0 +1,12 @@ +function addFlashMessage(message, type='success') { + let flask = document.createElement('p'); + flask.onclick = () => flask.remove(); + flask.classList.add(type); + flask.innerHTML = message; + + let close = document.createElement('span'); + close.innerHTML = ''; + + flask.appendChild(close); + document.querySelector('.flash').appendChild(flask); +} diff --git a/TFR/server/static/js/main.js b/TFR/server/static/js/sessions.js similarity index 54% rename from TFR/server/static/js/main.js rename to TFR/server/static/js/sessions.js index 7bee6f4..e2ec13a 100644 --- a/TFR/server/static/js/main.js +++ b/TFR/server/static/js/sessions.js @@ -1,32 +1,19 @@ -function addFlashMessage(message, type='success') { - let flask = document.createElement('p'); - flask.onclick = () => flask.remove(); - flask.classList.add(type); - flask.innerHTML = message; - - let close = document.createElement('span'); - close.innerHTML = ''; - - flask.appendChild(close); - document.querySelector('.flash').appendChild(flask); -} - -function yeetSession(id) { - let form = new FormData(); - form.append('session_id', id); - - fetch('/api/tokens', { - method: 'POST', - body: form, - }) - .then(response => response.json()) - .then(data => { - if (data.success) { - addFlashMessage(data.success, 'success'); - document.querySelector(`#sess-${id}`).remove(); - } else { - addFlashMessage(data.error, 'error'); - } - }) - .catch(error => addFlashMessage(error.error, 'error')); -} +function yeetSession(id) { + let form = new FormData(); + form.append('session_id', id); + + fetch('/api/tokens', { + method: 'POST', + body: form, + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + addFlashMessage(data.success, 'success'); + document.querySelector(`#sess-${id}`).remove(); + } else { + addFlashMessage(data.error, 'error'); + } + }) + .catch(error => addFlashMessage(error.error, 'error')); +} diff --git a/TFR/server/static/sass/style.sass b/TFR/server/static/sass/style.sass index aa4ca8e..7a04235 100644 --- a/TFR/server/static/sass/style.sass +++ b/TFR/server/static/sass/style.sass @@ -140,6 +140,11 @@ nav, nav > form .spacer width: 100% +@media (max-width: 700px) + nav, nav > form + &.compact + flex-direction: column + .flash display: flex flex-direction: column diff --git a/TFR/server/templates/account.html b/TFR/server/templates/account.html index c26590a..e275394 100644 --- a/TFR/server/templates/account.html +++ b/TFR/server/templates/account.html @@ -1,30 +1,23 @@ {% extends "base.html" %} -{% block nav %} -
- -{% endblock %} {% block content %} +
+

Hello, {{ current_user.username }}!

+

Sample text

+
+

Sessions

-

Devices and games that you logged into, yeet them if it wasn't you who logged in!

- {% if sessions %} - - {% for session in sessions %} - - - - - - - {% endfor %} -
{{ session.device_type }}{{ session.created_at.strftime('%Y-%m-%d') }}{{ session.last_used.strftime('%Y-%m-%d') }}
- {% else %} -

No sessions active. If you're looking to logout all website users, reset your password.

- {% endif %} +

Devices and games that you logged into. If you're looking to logout all website users, reset your password instead.

+ + {% for session in sessions %} + + + + + + + {% endfor %} +
{{ session.device_type }}{{ session.created_at.strftime('%Y-%m-%d') }}{{ session.last_used.strftime('%Y-%m-%d') }}
@@ -32,5 +25,6 @@

These actions are irreversible. Be careful!

Delete Account Reset Password + Logout
{% endblock %} diff --git a/TFR/server/templates/base.html b/TFR/server/templates/base.html index 72db985..b29b07b 100644 --- a/TFR/server/templates/base.html +++ b/TFR/server/templates/base.html @@ -1,68 +1,68 @@ - - - - Front Rooms Highscores - - - - - - - - - - {% assets "scripts" %}{% endassets %} - {% assets "styles" %}{% endassets %} - - -
-

Start typing to see results...

-
- - - - The Front Rooms Level select render - - -
- -
- {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {% for category, message in messages %} -

{{ message }}

- {% endfor %} - {% endif %} - {% endwith %} -
- -
- - - The Front Rooms logo - - - - - - {% block nav %}{% endblock %} -
- -
{% block content %}{% endblock %}
- - -
- + + + + Front Rooms Highscores + + + + + + + + + {% assets "styles" %}{% endassets %} + + + {% assets "scripts" %}{% endassets %} + + +
+

Start typing to see results...

+
+ + + + The Front Rooms Level select render + + +
+ +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +

{{ message }}

+ {% endfor %} + {% endif %} + {% endwith %} +
+ +
+ + + The Front Rooms logo + + + + + + {% block nav %}{% endblock %} +
+ +
{% block content %}{% endblock %}
+ + +
+ \ No newline at end of file diff --git a/TFR/server/templates/scores.html b/TFR/server/templates/scores.html index 13e1372..40b85a0 100644 --- a/TFR/server/templates/scores.html +++ b/TFR/server/templates/scores.html @@ -2,7 +2,7 @@ {% block nav %}