Update main page
This commit is contained in:
parent
dbbd8b4a99
commit
a29dc5b97c
@ -92,6 +92,12 @@ class MainView(BaseTemplateMixin, TemplateView):
|
|||||||
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)
|
||||||
return redirect('parts-main')
|
return redirect('parts-main')
|
||||||
|
@ -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 %}
|
Loading…
Reference in New Issue
Block a user