{% comment %}
# This file is part of k4ever, a point-of-sale system
#   Contact............  <k4ever@lists.someserver.de>
#   Website............  http://k4ever.someserver.de/
#   Bug tracker........  http://k4ever.someserver.de/report
#
# Licensed under GNU Affero General Public License v3 or later
{% endcomment %}

{% load navigation_extras %}

{% url transaction.views.overview as transactions %}
{% url main.views.startpage as home %}
{% url buyable.views.showItems as store %}
{% url buyable.views.history as history %}
{% url main.views.settings as settings %}
{% url django.contrib.auth.views.logout as logout %}
{% url django.contrib.auth.views.login as login %}
{% url main.views.register as register %}

<ul role="navigation sitemap" class="nav">
	{% if user.is_authenticated %}
		<li class="{% active request home %}"><a href="{{ home }}">Home</a></li>
		<li class="{% active request store %}"><a href="{{ store }}">Einkaufen</a></li>
		<li class="{% active request transactions %}"><a href="{{ transactions }}">Konto</a></li>
		<li class="{% active request history %}"><a href="{{ history }}">Frühere Einkäufe</a></li>
		<li class="divider-vertical" role="presentation"></li>
		<ul class="nav">
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="icon user"></span></a>
				<ul class="dropdown-menu">
					<li class="{% active request settings %}"><a href="{{ settings }}"><i class="icon-cog"></i> Einstellungen</a></li>
					{% if user.is_staff %}
						<li class=""><a href="/admin/"><i class="icon-lock"></i> Administration</a></li>
					{% endif %}
					<li class="{% active request logout %}"><a href="{{ logout }}"><i class="icon-off"></i> Abmelden</a></li>
				</ul>
			</li>
		</ul>
	{% else %}
		<li class="{% active request login %}"><a href="{{ login }}">Anmelden</a></li>
		<li class="{% active request register %}"><a href="{{ register }}">Registrieren</a></li>
	{% endif %}
</ul>

{% if user.is_authenticated %}
	<div class="pull-right">
		<span class="brand balance">Kontostand: {{ user.get_profile.balance|floatformat:2 }} €</span>
		<form class="navbar-search">
			<input placeholder="Suche und kaufe..." class="search-query autocomplete"
				type="search" name="search_term" value="Lade Daten..."
				disabled="disabled" />
		</form>
	</div>
{% endif %}