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 %} -
Sample text
+Devices and games that you logged into, yeet them if it wasn't you who logged in!
- {% if sessions %} -- | {{ session.device_type }} | -{{ session.created_at.strftime('%Y-%m-%d') }} | -{{ session.last_used.strftime('%Y-%m-%d') }} | -
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.
++ | {{ session.device_type }} | +{{ session.created_at.strftime('%Y-%m-%d') }} | +{{ session.last_used.strftime('%Y-%m-%d') }} | +
These actions are irreversible. Be careful!
Delete Account Reset Password + LogoutStart typing to see results...
-{{ message }}
- {% endfor %} - {% endif %} - {% endwith %} -Start typing to see results...
+{{ message }}
+ {% endfor %} + {% endif %} + {% endwith %} +