User menu

* starts user menu implementation
pull/2/head
mipel 3 years ago
parent b1ea9aa1e2
commit f0a33b360d

@ -62,6 +62,7 @@ INSTALLED_APPS = [
'intervention', 'intervention',
'organisation', 'organisation',
'news', 'news',
'user',
] ]
if DEBUG: if DEBUG:
INSTALLED_APPS += [ INSTALLED_APPS += [

@ -33,7 +33,7 @@ urlpatterns = [
path('eco-account/', include("intervention.urls")), #ToDo path('eco-account/', include("intervention.urls")), #ToDo
path('ema/', include("intervention.urls")), #ToDo path('ema/', include("intervention.urls")), #ToDo
path('organisation/', include("organisation.urls")), path('organisation/', include("organisation.urls")),
path('user/', include("intervention.urls")), #ToDo path('user/', include("user.urls")),
path('news/', include("news.urls")), path('news/', include("news.urls")),
# Autocomplete paths # Autocomplete paths

@ -53,7 +53,7 @@
{{ user.username }} {{ user.username }}
</div> </div>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="{% url 'logout' %}">{% fa5_icon 'cogs' %} {% trans 'Settings' %}</a> <a class="dropdown-item" href="{% url 'user:index' %}">{% fa5_icon 'cogs' %} {% trans 'Settings' %}</a>
<a class="dropdown-item" href="{% url 'logout' %}">{% fa5_icon 'sign-out-alt' %} {% trans 'Logout' %}</a> <a class="dropdown-item" href="{% url 'logout' %}">{% fa5_icon 'sign-out-alt' %} {% trans 'Logout' %}</a>
</div> </div>
</li> </li>

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

@ -0,0 +1,5 @@
from django.apps import AppConfig
class UserConfig(AppConfig):
name = 'user'

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

@ -0,0 +1,22 @@
{% extends 'base.html' %}
{% load i18n %}
{% block body %}
<div class="row">
<div class="col-md-3 border">
<table class="table">
<tr>
<th>{% trans 'Username' %}</th>
<td>{{user.username}}</td>
</tr>
<tr>
<th>{% trans 'Name' %}</th>
<td>{{user.first_name}} {{user.last_name}}</td>
</tr>
</table>
</div>
<div class="col-md">
</div>
</div>
{% endblock %}

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

@ -0,0 +1,15 @@
"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 08.07.21
"""
from django.urls import path
from user.views import index_view
app_name="user"
urlpatterns = [
path("", index_view, name="index"),
]

@ -0,0 +1,23 @@
from django.contrib.auth.decorators import login_required
from django.http import HttpRequest
from django.shortcuts import render
from konova.contexts import BaseContext
@login_required
def index_view(request: HttpRequest):
""" Renders the user's data index view
Args:
request ():
Returns:
"""
template = "user/index.html"
context = {
"user": request.user,
}
context = BaseContext(request, context).context
return render(request, template, context)
Loading…
Cancel
Save