This commit is contained in:
Daniel Grams 2020-06-07 19:44:09 +02:00
parent af99d922ad
commit 9ccea850c7
6 changed files with 22 additions and 4 deletions

5
app.py
View File

@ -60,5 +60,10 @@ def create_user():
def home():
return render_template('home.html')
@app.route("/profile")
@auth_required()
def profile():
return render_template('profile.html')
if __name__ == '__main__':
app.run()

View File

@ -1,6 +1,6 @@
{% extends "layout.html" %}
{% block title %}
Home
Prototyp
{% endblock %}
{% block content %}

View File

@ -49,11 +49,11 @@
{% if current_user.is_authenticated %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ _('Profile') }}
{{ _('You') }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<h6 class="dropdown-header">{{ current_user.email }}</h6>
<a class="dropdown-item" href="{{ url_for('profile') }}">{{ _('Profile') }}</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ url_for('security.logout') }}">{{ _('Logout') }}</a>
</div>

9
templates/profile.html Normal file
View File

@ -0,0 +1,9 @@
{% extends "layout.html" %}
{% block title %}
{{ _('Profile') }}
{% endblock %}
{% block content %}
{{ current_user.email }}
{% endblock %}

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-06-07 18:58+0200\n"
"POT-Creation-Date: 2020-06-07 19:43+0200\n"
"PO-Revision-Date: 2020-06-07 18:51+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
@ -23,6 +23,10 @@ msgid "Hi there!"
msgstr "Moin!"
#: templates/layout.html:52
msgid "You"
msgstr "Du"
#: templates/layout.html:56 templates/profile.html:3
msgid "Profile"
msgstr "Profil"