Add a navigation component.

This commit is contained in:
Dave Smith-Hayes 2024-12-05 14:13:11 +00:00
parent 2910b2e62f
commit d119e479f0
2 changed files with 13 additions and 11 deletions

View 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>

View File

@ -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' %}