mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Create a simple user settings view
This commit is contained in:
parent
5a81372ead
commit
3c6d5756c5
@ -30,7 +30,7 @@ from django.conf.urls.static import static
|
||||
from django.views.generic.base import RedirectView
|
||||
from rest_framework.documentation import include_docs_urls
|
||||
|
||||
from .views import IndexView, SearchView
|
||||
from .views import IndexView, SearchView, SettingsView
|
||||
|
||||
from users.urls import user_urls
|
||||
|
||||
@ -62,6 +62,8 @@ urlpatterns = [
|
||||
url(r'^login/', auth_views.LoginView.as_view(), name='login'),
|
||||
url(r'^logout/', auth_views.LogoutView.as_view(template_name='registration/logout.html'), name='logout'),
|
||||
|
||||
url(r'^settings/', SettingsView.as_view(), name='settings'),
|
||||
|
||||
url(r'^admin/', admin.site.urls, name='inventree-admin'),
|
||||
|
||||
url(r'^qr_code/', include(qr_code_urls, namespace='qr_code')),
|
||||
|
@ -414,3 +414,10 @@ class SearchView(TemplateView):
|
||||
context['query'] = query
|
||||
|
||||
return super(TemplateView, self).render_to_response(context)
|
||||
|
||||
|
||||
class SettingsView(TemplateView):
|
||||
""" View for configuring User settings
|
||||
"""
|
||||
|
||||
template_name = "InvenTree/settings.html"
|
||||
|
21
InvenTree/templates/InvenTree/settings.html
Normal file
21
InvenTree/templates/InvenTree/settings.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block page_title %}
|
||||
InvenTree | Settings
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>Settings</h3>
|
||||
<hr>
|
||||
|
||||
Logged in as {{ user.username }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_load %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
@ -19,7 +19,9 @@
|
||||
{% if user.is_authenticated %}
|
||||
{% if user.is_staff %}
|
||||
<li><a href="/admin/"><span class="glyphicon glyphicon-edit"></span> Admin</a></li>
|
||||
<hr>
|
||||
{% endif %}
|
||||
<li><a href="{% url 'settings' %}"><span class="glyphicon glyphicon-cog"></span> Settings</a></li>
|
||||
<li><a href="{% url 'logout' %}"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'login' %}"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user