User menu

* starts user menu implementation
This commit is contained in:
mipel
2021-07-08 11:07:33 +02:00
parent b1ea9aa1e2
commit f0a33b360d
11 changed files with 77 additions and 2 deletions

0
user/__init__.py Normal file
View File

3
user/admin.py Normal file
View File

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

5
user/apps.py Normal file
View File

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

3
user/models.py Normal file
View File

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

View File

@@ -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 %}

3
user/tests.py Normal file
View File

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

15
user/urls.py Normal file
View File

@@ -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"),
]

23
user/views.py Normal file
View File

@@ -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)