{% load i18n %}


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

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

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

		{% block menu_right %}
			{% if request.user.is_authenticated %}
				<ul class="navbar-nav">
					<li class="nav-item dropdown">
						<a class="nav-link dropdown-toggle" href="#" id="loginmenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
							{% trans 'Signed in as' %}
							{{ request.user.get_full_name|default:request.user }}
						</a>
						<div class="dropdown-menu" aria-labelledby="loginmenu">
							{% if cruditor.constants.change_password_url %}
								<a class="dropdown-item" href="{{ cruditor.constants.change_password_url }}">{% trans 'Change password' %}</a>
							{% endif %}
							<a class="dropdown-item" href="{{ cruditor.constants.logout_url }}">{% trans 'Logout' %}</a>
						</div>
					</li>
				</ul>
			{% endif %}
		{% endblock %}
	</div>
</nav>
