Add a navigation component.
This commit is contained in:
parent
2910b2e62f
commit
d119e479f0
12
app/templates/layouts/components/navigation.twig
Normal file
12
app/templates/layouts/components/navigation.twig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
{% if session.get('authenticated') %}
|
||||||
|
<li><a href="{{ url_for("dashboard") }}">Dashboard</a></li>
|
||||||
|
<li><a href="{{ url_for("user-logout") }}">Logout</a></li>
|
||||||
|
{% else %}
|
||||||
|
<li><a href="{{ url_for("user-login-page") }}">Login</a></li>
|
||||||
|
<li><a href="{{ url_for("user-register-page") }}">Register</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
@ -17,17 +17,7 @@
|
|||||||
{% block header %}{% endblock %}
|
{% block header %}{% endblock %}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<nav>
|
{% include 'layouts/components/navigation.twig' %}
|
||||||
<ul>
|
|
||||||
{% if session.get('authenticated') %}
|
|
||||||
<li><a href="{{ url_for("dashboard") }}">Dashboard</a></li>
|
|
||||||
<li><a href="{{ url_for("user-logout") }}">Logout</a></li>
|
|
||||||
{% else %}
|
|
||||||
<li><a href="{{ url_for("user-login-page") }}">Login</a></li>
|
|
||||||
<li><a href="{{ url_for("user-register-page") }}">Register</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
{% include 'layouts/components/flash.twig' %}
|
{% include 'layouts/components/flash.twig' %}
|
||||||
|
Loading…
Reference in New Issue
Block a user