{% extends "master.html" %}


{% block head %}
    <link href="{{ url_for('theme.static', filename='vendor/bootstrap-4.3.1/bootstrap.min.nodata.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ url_for('theme.static', filename='css/default.css') }}" rel="stylesheet" type="text/css">
{% endblock %}

{% block navbar %}
    <nav class="navbar navbar-expand-lg navbar-dark bg-info justify-content-between border-bottom">
        <a class="navbar-brand" href="{{ url_for('root.root') }}">noggin</a>
        {% if current_user %}
        <form><input id="search" type="search" class="typeahead form-control" autocomplete="off" placeholder="{{_('search...')}}"></form>
        <ul class="navbar-nav align-items-center">
            <li class="nav-item">
                <a class="nav-link color-white" href="{{ url_for('.groups') }}">{{_("Groups")}}</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <img src="{{ gravatar(current_user.mail if current_user.mail else 'default', 30) }}" class="bg-white"/>

                </a>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
                    <a class="dropdown-item" href="{{ url_for('.user', username=current_user.username) }}">{{_("Profile")}}</a>
                    <a class="dropdown-item" href="{{ url_for('.user_settings_profile', username=current_user.username) }}">{{_("Settings")}}</a>
                    <a class="dropdown-item" href="{{ url_for('.logout') }}">{{_("Log Out")}}</a>
                </div>
            </li>
        </ul>
        {% endif %}
    </nav>
    {% with flashes = get_flashed_messages(with_categories=True) %}
        {% if flashes %}
        <div class="container flash-messages fixed-top mt-5">
            {% for category, flash in flashes %}
            <div class="alert alert-{{ category }} alert-dismissible fade show">
                {{ flash }}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            {% endfor %}
        </div>
        {% endif %}
    {% endwith %}
{% endblock %}

{% block bodycontent %}
    <div class="mb-auto">
        {% block content %}{% endblock %}
    </div>
{% endblock %}

{% block footer %}
    <footer class="bg-light border-top py-4 mt-4">
        <div class="container h6 text-center">
            {% set noggin_link %}
                <a href="https://github.com/fedora-infra/noggin">noggin</a>
            {% endset %}
            <div><small>{{_("Powered by %(noggin_link)s", noggin_link=noggin_link)}}</small></div>
            <div class="text-muted"><small>{{ ipa.ipa_version|default('') }}</small></div>
        </div>
    </footer>
{% endblock %}

{% block scripts %}
    <script nonce="{{ csp_nonce() }}" src="{{ url_for('theme.static', filename='vendor/jquery/jquery-3.3.1.min.js') }}"></script>
    <script nonce="{{ csp_nonce() }}" src="{{ url_for('theme.static', filename='vendor/popper-1.14.7/popper.min.js') }}"></script>
    <script nonce="{{ csp_nonce() }}" src="{{ url_for('theme.static', filename='vendor/bootstrap-4.3.1/bootstrap.min.js') }}"></script>
    {{ super() }}
{% endblock %}


{# a required macro defining text to show on the unlogged in index page #}
{% macro front_page_blurb() %}
<h2 class="display-4">{{_("Welcome to noggin!")}}</h2>
<p class="lead">
    {{_("This is the open source, community self-service portal for FreeIPA. It allows you to do things like create an account, change your password, manage group membership, and more.")}}
</p>
{% endmacro %}



{# an optional macro defining an element to show for editing group details #}
{# typically, it used to link to a ticket tracker for an admin to edit a group #}
{#
{% macro edit_group_details() %}
{% endmacro %}
#}

{# an optional macro defining an element to show for account disable #}
{# typically, it used to link to a ticket tracker for an admin to perform the disable #}
{#
{% macro request_disable_account() %}
{% endmacro %}
#}

{# an optional macro defining an element to show for lost OTP tokens #}
{#
{% macro lost_otp_token() %}
{% endmacro %}
#}
