etiquette/frontends/etiquette_flask/templates/header.html
Ethan Dalool be0fca729f Create sessions for anons as well, instead of just logged in.
It makes sense that anon sessions are still sessions. So @give_token
will ensure that every request has a session. Logged in conditionals
move from 'if session' to 'if session.user'.
2018-01-15 18:41:21 -08:00

13 lines
No EOL
515 B
HTML

{% macro make_header(session) %}
<div id="header">
<a class="header_element" href="/">Etiquette</a>
<a class="header_element" href="/search">Search</a>
<a class="header_element" href="/tags">Tags</a>
{% if session.user %}
<a class="header_element" href="/user/{{session.user.username}}">{{session.user.username}}</a>
<a class="header_element" href="/logout" style="flex:0">Logout</a>
{% else %}
<a class="header_element" href="/login">Log in</a>
{% endif %}
</div>
{% endmacro %}