1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 23:55:24 +00:00
webvirtcloud/templates/navbar.html

53 lines
3.2 KiB
HTML
Raw Normal View History

2015-04-21 11:46:58 +00:00
{% load i18n %}
2020-06-15 08:46:13 +00:00
{% load icons %}
{% load common_tags %}
<!-- Fixed navbar -->
2020-05-26 13:18:38 +00:00
<nav class="navbar navbar-expand-md navbar-dark bg-primary mb-3" aria-label="Main top navbar">
<div class="container">
2020-05-19 16:53:54 +00:00
<a class="navbar-brand" href="{% url 'index' %}">WebVirtCloud</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="navbar-collapse collapse">
2020-05-19 16:53:54 +00:00
<ul class="navbar-nav mr-auto mt-2 mt-md-0">
<li class="nav-item {% class_active request '^/instances' %}">
2020-06-16 12:57:50 +00:00
<a class="nav-link" href="{% url 'instances:index' %}"><i class="fa fa-fw fa-desktop"></i> {% trans "Instances" %}</a>
</li>
{% if request.user.is_superuser %}
<li class="nav-item {% class_active request '^/computes' %}">
<a class="nav-link" href="{% url 'computes' %}"><i class="fa fa-fw fa-server"></i> {% trans "Computes" %}</a>
</li>
{% endif %}
</ul>
<ul class="navbar-nav navbar-right mt-2 mt-md-0">
{% if request.user.is_superuser %}
<li class="nav-item dropdown {% app_active request 'admin' %}">
<a class="nav-link" id="administration" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% icon 'wrench' %}
</a>
<div class="dropdown-menu" aria-labelledby="administration">
<a class="dropdown-item {% view_active request 'admin:user_list' %}" href="{% url 'admin:user_list' %}">{% icon 'user-plus' %} {% trans "Users" %}</a>
<a class="dropdown-item {% view_active request 'admin:group_list' %}" href="{% url 'admin:group_list' %}">{% icon 'users' %} {% trans "Groups" %}</a>
<a class="dropdown-item {% view_active request 'admin:logs' %}" href="{% url 'admin:logs' %}">{% icon 'list-alt' %} {% trans "Logs" %}</a>
<a class="dropdown-item {% view_active request 'appsettings' %}" href="{% url 'appsettings' %}">{% icon 'cogs' %} {% trans "Settings" %}</i></a>
</div>
</li>
{% endif %}
2020-05-19 16:53:54 +00:00
<li class="nav-item dropdown {% class_active request '^/accounts' %}">
<a class="nav-link dropdown-toggle" href="#" id="navbarUserDropdown" data-toggle="dropdown" role="button" aria-expanded="false">
<i class="fa fa-fw fa-user"></i> {{ request.user.username }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarUserDropdown">
{% get_current_language as LANGUAGE_CODE %}
<a class="dropdown-item disabled" href="#">
{% trans "Language" %}: <span class="badge badge-secondary">{{ LANGUAGE_CODE }}</span>
</a>
2020-10-14 08:37:46 +00:00
<a class="dropdown-item {% view_active request 'accounts:profile' %}" href="{% url 'accounts:profile' %}">{% icon 'vcard' %} {% trans "Profile" %}</a>
2020-05-19 16:53:54 +00:00
<div class="dropdown-divider"></div>
2020-10-14 08:37:46 +00:00
<a class="dropdown-item" href="{% url 'accounts:logout' %}"><i class="fa fa-fw fa-power-off"></i> {% trans "Log Out" %}</a>
2020-05-19 16:53:54 +00:00
</div>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>