Display username when logged in.

This commit is contained in:
Sage Vaillancourt 2022-09-23 14:14:06 -04:00
parent d5be15a827
commit 45eb4adff0
2 changed files with 6 additions and 2 deletions

View File

@ -75,10 +75,11 @@ def login_post():
@writing_blueprint.route('/', methods=['GET']) @writing_blueprint.route('/', methods=['GET'])
def index_get(): def index_get():
global index_cache global index_cache
if not index_cache: if not index_cache or 'username' in session:
index_cache = render_template( index_cache = render_template(
'writing.jinja2', 'writing.jinja2',
form=CLForm() form=CLForm(),
username=session['username']
) )
return index_cache return index_cache

View File

@ -41,6 +41,9 @@
<h1><span class="logo left">Under</span><span class="logo right">Cover</span></h1> <h1><span class="logo left">Under</span><span class="logo right">Cover</span></h1>
</a> </a>
<h2>The secret cover letter generator</h2> <h2>The secret cover letter generator</h2>
{% if username %}
<h3>You are logged in as {{ username }}</h3>
{% endif %}
{% from "_formhelpers.jinja2" import render_field %} {% from "_formhelpers.jinja2" import render_field %}
<form method=post id="letter-form"> <form method=post id="letter-form">