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,12 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<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 %}{% endblock %}
{% block header %}{% include "header_with_user.html" %}{% endblock %}
</div>
<div id="content">
{% block content %}{% endblock %}

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>