{% load i18n %}


<nav class="cruditor-navigation navbar bg-dark navbar-expand-lg mb-3" data-bs-theme="dark">
	<div class="container-fluid">
		{% block brand %}
			<a class="navbar-brand" href="{{ cruditor.constants.index_url }}">{{ cruditor.constants.menu_title }}</a>
		{% endblock %}

		<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#cruditor-nav" aria-controls="cruditor-nav" aria-expanded="false" aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>

		<div class="collapse navbar-collapse" id="cruditor-nav">
			{% block menu %}
				{% include cruditor.constants.menu_template_name %}
			{% endblock %}

			{% block menu_right %}
				{% if request.user.is_authenticated %}
					<ul class="navbar-nav ms-auto">
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">
								{% block greeting %}
									{% trans 'Signed in as' %}
									{{ request.user.get_full_name|default:request.user }}
								{% endblock %}
							</a>
							<div class="dropdown-menu">
								{% block loginmenu %}
									{% if cruditor.constants.change_password_url %}
										<a class="dropdown-item" href="{{ cruditor.constants.change_password_url }}">{% trans 'Change password' %}</a>
									{% endif %}
								{% endblock %}
								<div class="dropdown-divider"></div>
								{% block logoutform %}
									<form id="logout-form" method="post" action="{{ cruditor.constants.logout_url }}">
										{% csrf_token %}
										<button type="submit" class="dropdown-item">{% trans 'Logout' %}</button>
									</form>
								{% endblock %}
							</div>
						</li>
					</ul>
				{% endif %}
			{% endblock %}
		</div>
	</div>
</nav>
