2023-06-13 22:56:15 +00:00
|
|
|
{% if self.has_optional_user() %}
|
2023-06-13 19:34:54 +00:00
|
|
|
|
|
|
|
{% match user %}
|
|
|
|
{% when Some with (usr) %}
|
|
|
|
<div class="header_logged_in">
|
|
|
|
Hello, {{ usr.username }}!
|
2023-10-22 20:35:41 +00:00
|
|
|
<div>
|
|
|
|
<form action="/logout" enctype="application/x-www-form-urlencoded" method="post">
|
|
|
|
<button>
|
|
|
|
<input type="submit" value="sign out?" class="warning">
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
2023-06-13 19:34:54 +00:00
|
|
|
</div>
|
2023-09-23 22:22:45 +00:00
|
|
|
|
2023-09-24 18:47:09 +00:00
|
|
|
{% else %} <!-- this is for the `when` statement -->
|
2023-06-13 19:34:54 +00:00
|
|
|
<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 %}
|
|
|
|
|
2023-10-22 20:35:41 +00:00
|
|
|
<hr />
|
|
|
|
|
2023-09-24 18:47:09 +00:00
|
|
|
{% else %} <!-- this is for whether or not the template has a user field or not -->
|
2023-06-13 19:34:54 +00:00
|
|
|
|
|
|
|
{% endif %}
|