[ADD]user-leave-empty-view.html

This commit is contained in:
Horilla
2023-08-24 14:39:23 +05:30
parent 471c4eb1a1
commit d74861070f
5 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
{% extends 'index.html' %}{% block content %}
{% load i18n %}
{% load static %}
<div
class="oh-wrapper-main"
>
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style=" width: 150px;height: 150px;" src="{% static 'images/ui/leave_types.png' %}" class="oh-404__image" alt="Page not found. 404."/>
<h3 class="oh-404__subtitle">{% trans "Leave types not assigned to you" %}</h3>
<p class="oh-404__subtitle">{% trans "Please contact your administrators for assistance" %}</p>
</div>
</div>
</main>
</div>
</div>
{% endblock %}

View File

@@ -1242,9 +1242,13 @@ def user_leave_view(request):
page_number = request.GET.get("page")
page_obj = paginator_qry(queryset, page_number)
assigned_leave_filter = AssignedLeaveFilter()
if not queryset.exists():
template_name = "leave/user-leave-empty-view.html"
else:
template_name = "leave/user-leave-view.html"
return render(
request,
"leave/user-leave-view.html",
template_name,
{
"user_leaves": page_obj,
"form": assigned_leave_filter.form,

View File

@@ -0,0 +1,2 @@
[LocalizedFileNames]
edit_btn.png=@edit_btn,0

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB