mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added Login and Logout buttons to NavBar
This commit is contained in:
parent
47aa3c8a45
commit
3cf45f5ed3
@ -47,7 +47,7 @@ urlpatterns = [
|
|||||||
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
|
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||||
|
|
||||||
url(r'^login/', auth_views.login, name='login'),
|
url(r'^login/', auth_views.login, name='login'),
|
||||||
url(r'^logout/', auth_views.logout, name='logout'),
|
url(r'^logout/', auth_views.logout, {'template_name': 'registration/logout.html'}, name='logout'),
|
||||||
url(r'^admin/', admin.site.urls),
|
url(r'^admin/', admin.site.urls),
|
||||||
|
|
||||||
url(r'^api/', include(apipatterns)),
|
url(r'^api/', include(apipatterns)),
|
||||||
|
@ -11,5 +11,17 @@
|
|||||||
<li><a href="{% url 'build-index' %}">Build</a></li>
|
<li><a href="{% url 'build-index' %}">Build</a></li>
|
||||||
<li><a href="{% url 'company-index' %}">Companies</a></li>
|
<li><a href="{% url 'company-index' %}">Companies</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<li class='dropdown'>
|
||||||
|
<a class='dropdown-toggle' data-toggle='dropdown' href="#"><span class="glyphicon glyphicon-user"></span>{{ user.get_username }}</a>
|
||||||
|
<ul class='dropdown-menu'>
|
||||||
|
<li><a href="{% url 'logout' %}">Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li><a href="{% url 'login' %}"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
Loading…
Reference in New Issue
Block a user