{% extends 'bootstrap-base.html' %}

{% block html_attribs %} lang="en"{% endblock %}

{% block title %}{% if title %}{{ title }} - WPI ACM{% else %}WPI Association for Computing Machinery{%endif %}{% endblock %}

{% block head %}
{{super()}}

{% endblock %}

{% block navbar %}
<nav class="navbar mb-4 navbar-expand-lg">
    <div class="container-fluid">
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                                                     data-bs-target="#navbarSupportedContent"
                                                     aria-controls="navbarSupportedContent"
                                                     aria-expanded="true"
                                                     aria-label="Toggle
                                                                  navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="navbar-header">
            <a class="navbar-brand" href="{{ url_for('main.homepage') }}">
                <img src="{{url_for('static', filename='img/logo.png')}}"
                     alt="Logo" width="35" height="35" class="d-inline-block
                                       align-text-middle mx-2">WPI ACM</a>
        </div>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="nav navbar-nav me-auto mb-2 mb-lg-0">
                {{ render_nav_item('main.about', 'About')}}
                {{ render_nav_item('main.events', 'Events')}}
                {{ render_nav_item('main.join', 'Join Us!')}}
            </ul>
            <ul class="nav navbar-nav">
                {% if current_user.is_authenticated %}
                    {{ render_nav_item('dashboard.home', 'Dashboard') }}
                    {% if current_user.is_admin %}
                        {{ render_nav_item('admin.home', 'Admin Dash') }}
                    {% endif %}  
                    {{ render_nav_item('auth.logout', 'Logout') }}
                {% else %}
                    {{ render_nav_item('auth.login', 'Login with WPI') }}
                {% endif %}
            </ul>
        </div>
    </div>
</nav>
{% endblock %}
