From 443bd73abb59e1ab524bc5b876c1c3f04648c7a6 Mon Sep 17 00:00:00 2001 From: Timo Goettel Date: Fri, 13 Apr 2018 08:27:53 +0200 Subject: [PATCH] Add basic index/landing page TG-284 --- .../castellum_core/castellum_core/urls.py | 2 ++ .../castellum_core/templates/index.html | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 castellum_core/castellum_core/templates/index.html diff --git a/castellum_core/castellum_core/castellum_core/urls.py b/castellum_core/castellum_core/castellum_core/urls.py index dfc94b350..bd84346b1 100644 --- a/castellum_core/castellum_core/castellum_core/urls.py +++ b/castellum_core/castellum_core/castellum_core/urls.py @@ -1,9 +1,11 @@ from django.contrib import admin from django.urls import path from django.contrib.auth import views as auth_views +from django.views.generic import TemplateView urlpatterns = [ + path('', TemplateView.as_view(template_name='index.html'), name='index'), path('login/', auth_views.LoginView.as_view(template_name="login.html"), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), diff --git a/castellum_core/castellum_core/templates/index.html b/castellum_core/castellum_core/templates/index.html new file mode 100644 index 000000000..27ed1d310 --- /dev/null +++ b/castellum_core/castellum_core/templates/index.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} +{% load i18n bootstrap4 %} + +{% block title %}{% trans "Start" %} · {{ block.super }}{% endblock %} + +{% block content %} + {% if request.user.is_authenticated %} +
+ {% if request.user.is_superuser %} +
You are logged in as admin
+ {% else %} +
You are not listed as admin
+ {% endif %} +
You are registered since {{ request.user.date_joined|timesince}}
+
+ {% else %} +
+ Not logged in +
+ {% endif %} +{% endblock %} -- GitLab