From 734f51b3e4cb17bb247c1ff9f74ae96e521f4104 Mon Sep 17 00:00:00 2001 From: gboeker Date: Mon, 4 Mar 2024 16:58:01 -0500 Subject: [PATCH 1/3] move logout button to top, and only when logged in --- app.py | 4 ++-- templates/base.html | 4 ++++ templates/card.html | 3 --- templates/decks.html | 2 -- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index c324c1f..229abad 100644 --- a/app.py +++ b/app.py @@ -21,10 +21,10 @@ def home(): elif 'sign-up' in request.form: return redirect(url_for('signup')) elif 'play-as-guest' in request.form: - return redirect(url_for('allDecks', username='guest')) + return redirect(url_for('allDecks', username='guest', isAuth=False)) if request.method == 'GET': if (current_user.is_authenticated): - return redirect(url_for('allDecks', username=current_user.id)) + return redirect(url_for('allDecks', username=current_user.id, isAuth=True)) return render_template('start.html') # Handle authentication related stuff in authentication.py file diff --git a/templates/base.html b/templates/base.html index 283237d..fe82ff2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,6 +8,10 @@ /> + {% if isAuth %} + {% from 'macros.html' import logout %} + {{ logout() }} + {% endif %}
diff --git a/templates/card.html b/templates/card.html index a127b91..c305d42 100644 --- a/templates/card.html +++ b/templates/card.html @@ -44,9 +44,6 @@

START

- {% from 'macros.html' import logout %} - {{ logout() }} - {% endif %} diff --git a/templates/decks.html b/templates/decks.html index 6efb367..86e105d 100644 --- a/templates/decks.html +++ b/templates/decks.html @@ -69,8 +69,6 @@

+

}) - {% from 'macros.html' import logout %} - {{ logout() }} {% endif %} From bbed353a6c7640202a1c508f9dd86d7a40a27786 Mon Sep 17 00:00:00 2001 From: gboeker Date: Mon, 4 Mar 2024 18:02:44 -0500 Subject: [PATCH 2/3] change logout button --- app.py | 4 ++-- static/css/style.css | 10 ++++++++++ templates/base.html | 9 ++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 229abad..c324c1f 100644 --- a/app.py +++ b/app.py @@ -21,10 +21,10 @@ def home(): elif 'sign-up' in request.form: return redirect(url_for('signup')) elif 'play-as-guest' in request.form: - return redirect(url_for('allDecks', username='guest', isAuth=False)) + return redirect(url_for('allDecks', username='guest')) if request.method == 'GET': if (current_user.is_authenticated): - return redirect(url_for('allDecks', username=current_user.id, isAuth=True)) + return redirect(url_for('allDecks', username=current_user.id)) return render_template('start.html') # Handle authentication related stuff in authentication.py file diff --git a/static/css/style.css b/static/css/style.css index e1097c2..8da90ff 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -264,3 +264,13 @@ p a{ #card-form textarea:focus { outline: none; } + +.logout { + float: right; + background-color: #7d6f6b; + color: #FAFAFA; + font-size: 30px; + border-radius: 4px; + font-weight: bold; + padding: 20px; +} diff --git a/templates/base.html b/templates/base.html index fe82ff2..965bf2c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,12 +8,15 @@ /> - {% if isAuth %} - {% from 'macros.html' import logout %} - {{ logout() }} + + {% if isAuth %} +
Logout {% endif %} + +
+

DIVE DEEPER

From 7a73209d845f62eed14e7122a86373226f146c62 Mon Sep 17 00:00:00 2001 From: gboeker Date: Mon, 4 Mar 2024 18:05:22 -0500 Subject: [PATCH 3/3] delete logout file --- templates/macros.html | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 templates/macros.html diff --git a/templates/macros.html b/templates/macros.html deleted file mode 100644 index ed3a4a1..0000000 --- a/templates/macros.html +++ /dev/null @@ -1,5 +0,0 @@ -{% macro logout() %} -
- -
-{% endmacro %}