add user-aware header

This commit is contained in:
Joe Ardent 2023-06-13 14:33:31 -07:00
parent 4026bf16b7
commit ec2b60098e
7 changed files with 46 additions and 15 deletions

View file

@ -1,18 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>{% block title %}{{ title }} - Witch Watch{% endblock %}</title>
{% block head %}{% endblock %}
</head>
<body>
<div id="header">
{% block header %}{% endblock %}
</div>
<div id="content">
{% block content %}{% endblock %}
</div>
<div id="footer">
{% block footer %}{% endblock %}
</div>
</body>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{{ title }} - Witch Watch{% endblock %}</title>
{% block head %}{% endblock %}
</head>
<body>
<div id="header">
{% block header %}{% include "header_with_user.html" %}{% endblock %}
</div>
<div id="content">
{% block content %}{% endblock %}
</div>
<div id="footer">
{% block footer %}{% endblock %}
</div>
</body>
</html>

View file

@ -0,0 +1,20 @@
{% match user %}
{% when Some with (usr) %}
<div class="header_logged_in">
Hello, {{ usr.username }}!
</div>
<div class="header_signout">
<input type="submit" value="sign out?">
</form>
</div>
{% else %}
<div class="header_logged_out">
Heya, why don't you <a href="/login">log in</a> or <a href="/signup">sign up</a>?
</div>
{% endmatch %}
<hr/>

View file

@ -2,6 +2,8 @@
{% block title %}Login to Witch Watch, Bish{% endblock %}
{% block header %}{% endblock %}
{% block content %}
<p>

View file

@ -2,6 +2,8 @@
{% block title %}Logout of Witch Watch, Bish{% endblock %}
{% block header %}{% endblock %}
{% block content %}
<p>

View file

@ -2,6 +2,8 @@
{% block title %}Thanks for Signing Up for Witch Watch, Bish{% endblock %}
{% block header %}{% endblock %}
{% block content %}
<h1>Goodbye</h1>

View file

@ -2,6 +2,8 @@
{% block title %}Sign Up for Witch Watch, Bish{% endblock %}
{% block header %} {% endblock %}
{% block content %}
<p>

View file

@ -3,6 +3,7 @@
{% block title %}Thanks for Signing Up for Witch Watch, Bish{% endblock %}
{% block content %}
{% block header %}{% endblock %}
<h1>You did it!</h1>