{% extends "base.html" %}
{% load i18n %}

{% block header %}
    <nav id="mainNavbar" class="navbar navbar-expand-lg navbar-light fixed-top">
        <div class="container">
            <a class="navbar-brand" href="{% url "food_planner:index" %}">
                <span class="fal fa-comment-alt-dots d-inline-block align-top"></span>
                {{ site.title }}
            </a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                    aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    {% if request.user.is_authenticated %}
                        <li class="nav-item{% if active == "edit_profile" %} active{% endif %}">
                            <a class="nav-link" href="{% url "edit_profile" %}">
                                {% trans "Edit Profile" %}{% if active == "edit_profile" %}
                                    <span class="sr-only">(current)</span>
                                {% endif %}
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{% url "logout" %}">
                                {% trans "Logout" %}
                            </a>
                        </li>
                    {% else %}
                        <li class="nav-item{% if active == "login" %} active{% endif %}">
                            <a class="nav-link" href="{% url "login" %}">
                                {% trans "Login" %}{% if active == "login" %}
                                    <span class="sr-only">(current)</span>
                                {% endif %}
                            </a>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>

    </nav>
{% endblock %}

{% block footer %}
    <div class="col">
        <nav>
            <ul class="nav">
                <li class="nav-item">
                    <a class="nav-link" href="{% url "food_planner:legal" %}">{% trans "Legal Notice" %}</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{% url "food_planner:privacy" %}">{% trans "Privacy Policy" %}</a>
                </li>
            </ul>
        </nav>
    </div>
{% endblock %}
