gestioCOF/kfet/templates/kfet/base_nav.html

110 lines
4.1 KiB
HTML
Raw Normal View History

{% load static %}
{% load wagtailcore_tags %}
2016-08-12 11:41:52 +02:00
<nav class="navbar navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="{% slugurl "k-fet" %}">
2016-08-12 11:41:52 +02:00
<img src="{% static 'kfet/img/logo3.png' %}">
</a>
</div>
<ul class="nav navbar-nav">
{% for item in menu_items %}
{% if item.text == "Accueil" %}
<li class="{{ item.active_class }} hidden-xs hidden-sm">
<a href="{{ item.href }}" title="Accueil">
<span class="glyphicon glyphicon-home"></span>
</a>
</li>
{% else %}
<li class="{{ item.active_class }} hidden-xs hidden-sm">
<a href="{{ item.href }}">
{{ item.text }}
</a>
</li>
{% endif %}
{% endfor %}
<li class="dropdown visible-xs visible-sm nav-pages">
<a href="#" data-toggle="dropdown" roles="button" aria-haspopup="true" aria-expanded="false" class="navbar-toggle">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<ul class="dropdown-menu">
{% for item in menu_items %}
<li>
<a href="{{ item.href }}">
{{ item.text }}
</a>
</li>
{% endfor %}
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right nav-app">
{% if user.username == 'kfet_genericteam' %}
{% include "kfet/nav_item.html" with text="Équipe standard" %}
{% elif user.profile.account_kfet.readable %}
{% url "kfet.account.read" user.profile.account_kfet.trigramme as url_my_account %}
{% include "kfet/nav_item.html" with href=url_my_account glyphicon="user" text="Mon compte" %}
{% endif %}
{% if perms.kfet.is_team %}
{% include "kfet/nav_item.html" with url="kfet.kpsul" glyphicon="shopping-cart" text="K-Psul" %}
{% include "kfet/nav_item.html" with url="kfet.transfers" glyphicon="transfer" text="Transferts" %}
{% include "kfet/nav_item.html" with url="kfet.history" glyphicon="th-list" text="Historique" %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-option-vertical"></span>
</a>
<ul class="dropdown-menu">
<li class="divider"></li>
<li><a href="{% url 'kfet.account' %}">Comptes</a></li>
<li><a href="{% url 'kfet.checkout' %}">Caisses</a></li>
<li class="divider"></li>
<li><a href="{% url 'kfet.article' %}">Articles</a></li>
<li><a href="{% url 'kfet.inventory' %}">Inventaires</a></li>
<li><a href="{% url 'kfet.order' %}">Commandes</a></li>
{% if user.username != 'kfet_genericteam' %}
<li class="divider"></li>
<li><a href="{% url 'kfet.login.genericteam' %}" target="_blank" class="genericteam">Connexion standard</a></li>
{% endif %}
{% if perms.kfet.change_settings %}
<li><a href="{% url 'kfet.settings' %}">Paramètres</a></li>
{% endif %}
<li class="divider"></li>
<li>
<a href="{% url "cof-logout" %}?next=/k-fet/">
<span class="glyphicon glyphicon-log-out"></span><span>Déconnexion</span>
</a>
</li>
</ul>
</li>
{% endif %}
{% if user.is_authenticated and not perms.kfet.is_team %}
<li>
<a href="{% url "cof-logout" %}?next=/k-fet/" title="Déconnexion">
<span class="glyphicon glyphicon-log-out"></span>
</a>
</li>
{% elif not user.is_authenticated %}
<li>
<a href="{% url "cof-login" %}?next={{ request.path }}" title="Connexion">
<span>Connexion</span><!--
--><span class="glyphicon glyphicon-log-in"></span>
</a>
</li>
{% endif %}
</ul>
</div>
</nav>
<script type="text/javascript">
$(document).ready(function () {
$('.genericteam').on('click', function () {
setTimeout(function () { location.reload() }, 1000);
});
});
</script>