From a29dc5b97c487b1a95471c3694e88c093bbcdb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 1 Jan 2022 22:47:12 +0100 Subject: [PATCH] Update main page --- shimatta_kenkyusho/parts/views.py | 6 ++++++ shimatta_kenkyusho/templates/parts/main.html | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/shimatta_kenkyusho/parts/views.py b/shimatta_kenkyusho/parts/views.py index 0442aec..9935779 100644 --- a/shimatta_kenkyusho/parts/views.py +++ b/shimatta_kenkyusho/parts/views.py @@ -91,6 +91,12 @@ class MainView(BaseTemplateMixin, TemplateView): template_name = 'parts/main.html' navbar_selected = 'Main' base_title = 'Main' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['user'] = self.request.user + return context + def logout_view(request): logout(request) diff --git a/shimatta_kenkyusho/templates/parts/main.html b/shimatta_kenkyusho/templates/parts/main.html index 94d05cc..509bc06 100644 --- a/shimatta_kenkyusho/templates/parts/main.html +++ b/shimatta_kenkyusho/templates/parts/main.html @@ -1,5 +1,17 @@ {% extends 'base.html' %} {% block content %} +{% if user.is_authenticated %} Hi +{% else %} +
+
+
+
+

Shimatta Stock Management System. Login now.

+
+
+
+
+{% endif %} {% endblock content %} \ No newline at end of file