Update main page

This commit is contained in:
Mario Hüttel 2022-01-01 22:47:12 +01:00
parent dbbd8b4a99
commit a29dc5b97c
2 changed files with 18 additions and 0 deletions

View File

@ -91,6 +91,12 @@ class MainView(BaseTemplateMixin, TemplateView):
template_name = 'parts/main.html' template_name = 'parts/main.html'
navbar_selected = 'Main' navbar_selected = 'Main'
base_title = '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): def logout_view(request):
logout(request) logout(request)

View File

@ -1,5 +1,17 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block content %} {% block content %}
{% if user.is_authenticated %}
Hi Hi
{% else %}
<section class="bg-dark text-light p-5 text-center">
<div class="container">
<div class="d-sm-flex">
<div>
<h1>Shimatta Stock Management System. <a href="{% url 'login' %}" class="text-decoration-none text-warning">Login now</a>.</h1>
</div>
</div>
</div>
</section>
{% endif %}
{% endblock content %} {% endblock content %}