24 lines
667 B
HTML
24 lines
667 B
HTML
{% if self.has_optional_user() %}
|
|
|
|
{% match user %}
|
|
{% when Some with (usr) %}
|
|
<div class="header_logged_in">
|
|
Hello, {{ usr.username }}!
|
|
<div>
|
|
<form action="/logout" enctype="application/x-www-form-urlencoded" method="post">
|
|
<button>
|
|
<input type="submit" value="sign out?" class="warning">
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{% when None %} <!-- this is for the `when` statement -->
|
|
<div class="header_logged_out">
|
|
<a href="/login">log in</a> or <a href="/signup">sign up</a>?
|
|
</div>
|
|
{% endmatch %}
|
|
|
|
{% else %} <!-- this is for whether or not the template has a user field or not -->
|
|
|
|
{% endif %}
|