Add login, user_edit, user_info
This commit is contained in:
@@ -5,8 +5,18 @@
|
||||
<body>
|
||||
<nav>
|
||||
<a href="{{ url_for('index') }}">Home</a>
|
||||
{% if 'user_id' in session %}
|
||||
<a href="{{ url_for('user_edit') }}">{{ session.get('username', '???') }}</a>
|
||||
|
|
||||
<a href="{{ url_for('logout') }}">Logout</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('login') }}">Login</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
<h1>{{ title }}</h1>
|
||||
{% for category, msg in get_flashed_messages(True) %}
|
||||
<p>{{ category}}: {{ msg }}</p>
|
||||
{% endfor %}
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
9
templates/login.html
Normal file
9
templates/login.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<p>Username: <input type="text" name="username"></p>
|
||||
<p>Password: <input type="password" name="password"></p>
|
||||
<input type="submit" value="Login">
|
||||
</form>
|
||||
{% endblock %}
|
||||
9
templates/user_edit.html
Normal file
9
templates/user_edit.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<p>{{ name }}</p>
|
||||
<textarea name="about">{{ about }}</textarea>
|
||||
<input type="submit" value="Update">
|
||||
</form>
|
||||
{% endblock %}
|
||||
6
templates/user_info.html
Normal file
6
templates/user_info.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<p>{{ name }}</p>
|
||||
<p>{{ about }}<p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user