From fc16bdfe8d704d8f64ededb32facf257ecba51af Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 31 Jan 2024 12:07:13 +0530 Subject: [PATCH] [UPDT] GENERAL: Empty page for views if no records are present --- .../base/action_type/action_type.html | 11 +- base/templates/base/company/company.html | 13 +- .../templates/base/department/department.html | 30 +- .../base/employee_type/employee_type.html | 12 +- .../base/job_position/job_position.html | 12 +- base/templates/base/job_role/job_role.html | 11 +- .../base/mail_server/mail_server.html | 13 +- .../rotating_work_type.html | 10 +- .../rotating_work_type_assign_empty.html | 6 +- base/templates/base/shift/schedule.html | 11 +- base/templates/base/shift/shift.html | 5 +- base/templates/base/shift/shift_view.html | 261 +++++++++--------- base/templates/base/tags/tags.html | 29 +- .../base/ticket_type/ticket_type.html | 11 +- base/templates/base/work_type/work_type.html | 12 +- .../shift_request/htmx/empty_request.html | 6 +- .../work_type_request/htmx/empty_request.html | 6 +- employee/filters.py | 3 + employee/templates/dashboard/not_in_yet.html | 78 +++--- employee/templates/dashboard/not_out_yet.html | 60 ++-- .../disciplinary_nav.html | 25 +- employee/templates/documents/requests.html | 6 +- .../templates/employee_export_filter.html | 24 +- employee/templates/employee_filters.html | 34 +-- employee/templates/employee_nav.html | 8 +- .../templates/policies/view_policies.html | 15 +- .../department_managers.html | 11 +- helpdesk/templates/helpdesk/faq/faq_view.html | 2 +- .../leave/leave_request/leave_requests.html | 28 +- .../leave/leave_request/penalty/create.html | 110 ++++---- .../leave/leave_request/request_view.html | 3 + .../templates/onboarding/candidates_view.html | 3 +- .../templates/onboarding/onboarding_view.html | 96 +++---- .../payroll/allowance/view_allowance.html | 20 +- .../payroll/deduction/view_deduction.html | 20 +- payroll/templates/payroll/loan/filter.html | 4 +- payroll/templates/payroll/loan/view_loan.html | 15 +- .../payroll/payslip/view_payslips.html | 38 ++- .../reimbursement/view_reimbursement.html | 17 +- payroll/views/component_views.py | 2 +- .../question_template_empty.html | 1 + pms/templates/period/period_empty.html | 4 +- .../offerletter/empty_mail_template.html | 89 ++++++ .../skill_zone/empty_skill_zone.html | 16 ++ .../templates/skill_zone/skill_zone_view.html | 6 +- recruitment/views/mail_templates.py | 7 +- static/images/ui/Hour_glass.png | Bin 0 -> 15804 bytes static/images/ui/approve.png | Bin 0 -> 17433 bytes static/images/ui/company.png | Bin 0 -> 8366 bytes static/images/ui/conditions.png | Bin 0 -> 14073 bytes static/images/ui/connection.png | Bin 0 -> 36291 bytes static/images/ui/email.png | Bin 0 -> 18175 bytes static/images/ui/employee_group.png | Bin 0 -> 38581 bytes static/images/ui/employee_shift.png | Bin 0 -> 19882 bytes static/images/ui/employee_type.png | Bin 0 -> 28036 bytes static/images/ui/faq.png | Bin 0 -> 10113 bytes static/images/ui/insurance-policy.png | Bin 0 -> 15678 bytes static/images/ui/job-position.png | Bin 0 -> 21795 bytes static/images/ui/job_role.png | Bin 0 -> 16962 bytes static/images/ui/legal.png | Bin 0 -> 12147 bytes static/images/ui/loan.png | Bin 0 -> 18428 bytes static/images/ui/manager.png | Bin 0 -> 27414 bytes static/images/ui/payment.png | Bin 0 -> 15845 bytes static/images/ui/price-tag.png | Bin 0 -> 11795 bytes static/images/ui/reimbursement.png | Bin 0 -> 16083 bytes static/images/ui/rotating_work_type.png | Bin 0 -> 24191 bytes static/images/ui/salary.png | Bin 0 -> 25271 bytes static/images/ui/shift_schedule.png | Bin 0 -> 14705 bytes static/images/ui/work-type.png | Bin 0 -> 21452 bytes 69 files changed, 776 insertions(+), 428 deletions(-) create mode 100644 recruitment/templates/offerletter/empty_mail_template.html create mode 100644 recruitment/templates/skill_zone/empty_skill_zone.html create mode 100644 static/images/ui/Hour_glass.png create mode 100644 static/images/ui/approve.png create mode 100644 static/images/ui/company.png create mode 100644 static/images/ui/conditions.png create mode 100644 static/images/ui/connection.png create mode 100644 static/images/ui/email.png create mode 100644 static/images/ui/employee_group.png create mode 100644 static/images/ui/employee_shift.png create mode 100644 static/images/ui/employee_type.png create mode 100644 static/images/ui/faq.png create mode 100644 static/images/ui/insurance-policy.png create mode 100644 static/images/ui/job-position.png create mode 100644 static/images/ui/job_role.png create mode 100644 static/images/ui/legal.png create mode 100644 static/images/ui/loan.png create mode 100644 static/images/ui/manager.png create mode 100644 static/images/ui/payment.png create mode 100644 static/images/ui/price-tag.png create mode 100644 static/images/ui/reimbursement.png create mode 100644 static/images/ui/rotating_work_type.png create mode 100644 static/images/ui/salary.png create mode 100644 static/images/ui/shift_schedule.png create mode 100644 static/images/ui/work-type.png diff --git a/base/templates/base/action_type/action_type.html b/base/templates/base/action_type/action_type.html index 111665ad2..b6a187cf5 100644 --- a/base/templates/base/action_type/action_type.html +++ b/base/templates/base/action_type/action_type.html @@ -1,6 +1,6 @@ {% extends 'settings.html' %} {% load i18n %} -{% block settings %} +{% block settings %}{% load static %}
@@ -18,7 +18,14 @@ {% endif %}
- {% include 'base/action_type/action_type_view.html' %} + {% if action_types %} + {% include 'base/action_type/action_type_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no disciplinary action type at this moment." %}
+
+ {% endif %}
diff --git a/base/templates/base/company/company.html b/base/templates/base/company/company.html index ff3fe925d..5a481454e 100644 --- a/base/templates/base/company/company.html +++ b/base/templates/base/company/company.html @@ -1,4 +1,4 @@ -{% extends 'settings.html' %} {% load i18n %} {% block settings %} +{% extends 'settings.html' %} {% load i18n %} {% block settings %}{% load static %}
{% if perms.base.view_company %}
{% endif %}
- - {% include 'base/company/company_view.html' %} {% endif %} + {% if companies %} + {% include 'base/company/company_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no companies at this moment." %}
+
+ {% endif %} + {% endif %}
{% if perms.base.view_department %}

{% trans "Department" %}

{% if perms.base.add_department %} - {% endif %}
- {% include 'base/department/department_view.html' %} {% endif %} + {% if departments %} + {% include 'base/department/department_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no department at this moment." %}
+
+ {% endif %} + {% endif %}
{% if perms.base.view_employeetype %}
{% endif %}
+ {% if employee_types %} + {% include 'base/employee_type/type_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no employee type at this moment." %}
+
+ {% endif %} - {% include 'base/employee_type/type_view.html' %} {% endif %} + {% endif %}
{% if perms.base.view_jobposition %}
@@ -16,7 +16,15 @@ {% endif %}
- {% include 'base/job_position/job_position_view.html' %} {% endif %} + {% if jobs %} + {% include 'base/job_position/job_position_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no job positions at this moment." %}
+
+ {% endif %} + {% endif %}
{% if perms.base.view_jobrole %}
@@ -16,7 +16,14 @@ {% endif %}
- {% include 'base/job_role/job_role_view.html' %} + {% if job_role %} + {% include 'base/job_role/job_role_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no Job roles at this moment." %}
+
+ {% endif %} {% endif %}
diff --git a/base/templates/base/mail_server/mail_server.html b/base/templates/base/mail_server/mail_server.html index 318af0fa0..cb4253c25 100644 --- a/base/templates/base/mail_server/mail_server.html +++ b/base/templates/base/mail_server/mail_server.html @@ -1,4 +1,4 @@ -{% extends 'settings.html' %} {% load i18n %} {% block settings %} +{% extends 'settings.html' %} {% load i18n %} {% block settings %}{% load static %}
{% if perms.base.view_dynamicemailconfiguration %}
{% endif %}
- - {% include 'base/mail_server/mail_server_view.html' %} {% endif %} + {% if mail_servers %} + {% include 'base/mail_server/mail_server_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no mail server at this moment." %}
+
+ {% endif %} + {% endif %}
{% if perms.base.view_rotatingworktype %}
@@ -18,9 +19,16 @@ {% endif %}
+ {% if jobs %} + {% include 'base/rotating_work_type/rotating_work_type_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no rotating work types at this moment." %}
+
+ {% endif %} {% endif %} - {% include 'base/rotating_work_type/rotating_work_type_view.html' %}
-

- {% trans "Rotating work type not assigned to employees" %} -

+
+ {% trans "There are currently no employees assigned to work type to be considered." %} +
diff --git a/base/templates/base/shift/schedule.html b/base/templates/base/shift/schedule.html index e38af4645..b616e8974 100644 --- a/base/templates/base/shift/schedule.html +++ b/base/templates/base/shift/schedule.html @@ -1,6 +1,6 @@ {% extends 'settings.html' %} {% load i18n %} -{% block settings %} +{% block settings %}{% load static %}
{% if perms.base.view_employeeshiftschedule %}
@@ -18,9 +18,16 @@ {% endif %}
+ {% if shift_schedule %} + {% include 'base/shift/schedule_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no shift schedule at this moment." %}
+
+ {% endif %} {% endif %} - {% include 'base/shift/schedule_view.html' %}
{% if perms.base.view_employeeshift %}
{% endif %}
- {% include 'base/shift/shift_view.html' %} {% endif %} + {% include 'base/shift/shift_view.html' %} + {% endif %}
-
-
-
-
-
{% trans "Shift" %}
-
{% trans "Weekly Full Time" %}
-
{% trans "Full Time" %}
-
{% trans "Grace Time" %}
- {% if perms.base.change_employeeshift or perms.base.delete_employeeshift %} -
- {% endif %} +{% if shifts %} +
+
+
+
+
{% trans "Shift" %}
+
{% trans "Weekly Full Time" %}
+
{% trans "Full Time" %}
+
{% trans "Grace Time" %}
+ {% if perms.base.change_employeeshift or perms.base.delete_employeeshift %} +
+ {% endif %} +
-
-
- {% for shift in shifts %} -
-
{{shift}}
-
{{shift.weekly_full_time}}
-
{{shift.full_time}}
- {% if shift.grace_time_id %} -
{{shift.grace_time_id}}
- {% else %} -
{% trans "Nil" %}
- {% endif %} - {% if perms.base.change_employeeshift or perms.base.delete_employeeshift %} -
-
- {% if perms.base.change_employeeshift %} - - - {% endif %} - {% if perms.base.delete_employeeshift %} -
- {% csrf_token %} - - - {% endif %} +
+ {% endif %} + {% if perms.base.delete_employeeshift %} +
+ {% csrf_token %} + +
+ {% endif %} +
-
- {% endif %} + {% endif %} +
+ {% endfor %}
- {% endfor %}
-
+{% else %} +
+ Page not found. 404. +
{% trans "There is no employee shifts at this moment." %}
+
+{% endif %} +
@@ -82,82 +90,87 @@
{% if grace_times %}
-
-
-
-
- {% trans 'Allowed time' %} +
+
+
+
+ {% trans 'Allowed time' %} +
+
+ {% trans 'Is active' %} +
+ {% if perms.attendance.change_gracetime %} +
{% trans 'Actions' %}
+ {% endif %}
-
- {% trans 'Is active' %}
- {% if perms.attendance.change_gracetime %} -
{% trans 'Actions' %}
- {% endif %} -
-
-
- {% for grace_time in grace_times %} -
-
{{ grace_time.allowed_time }} {% trans 'Minutes' %}
-
-
-
- {% if perms.attendance.change_gracetime%} - - {% else %} - - {% endif %} -
-
-
- {% if perms.attendance.change_gracetime%} +
+ {% for grace_time in grace_times %} +
+
{{ grace_time.allowed_time }} {% trans 'Minutes' %}
-
- {% if perms.base.change_gracetime %} - - - {% endif %} - {% if perms.base.delete_gracetime %} -
- {% csrf_token %} - -
+
+
+ {% if perms.attendance.change_gracetime%} + {% else %} - + {% endif %}
+
- {% endif %} -
- {% endfor %} - + {% if perms.attendance.change_gracetime%} +
+
+ {% if perms.base.change_gracetime %} + + + {% endif %} + {% if perms.base.delete_gracetime %} +
+ {% csrf_token %} + +
+ {% else %} + + {% endif %} +
+
+ {% endif %} +
+ {% endfor %} + +
+ {% else %} +
+ Page not found. 404. +
{% trans "There is no grace time at this moment." %}
{% endif %}
diff --git a/base/templates/base/tags/tags.html b/base/templates/base/tags/tags.html index 83e488c0f..725471ddf 100644 --- a/base/templates/base/tags/tags.html +++ b/base/templates/base/tags/tags.html @@ -1,6 +1,6 @@ {% extends 'settings.html' %} {% load i18n %} -{% block settings %} +{% block settings %}{% load static %} @@ -21,7 +21,14 @@ {% endif %}
- {% include 'base/employee_tag/employee_tag_view.html' %} + {% if employeetags %} + {% include 'base/employee_tag/employee_tag_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no employee tags at this moment." %}
+
+ {% endif %} {% endif %}
@@ -91,7 +98,14 @@ {% endif %}
- {% include 'base/tags/tags_view.html' %} + {% if tags %} + {% include 'base/tags/tags_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no helpdesk tags at this moment." %}
+
+ {% endif %} {% endif %}
@@ -160,7 +174,14 @@ {% endif %}
- {% include 'base/audit_tag/audit_tag_view.html' %} + {% if audittags %} + {% include 'base/audit_tag/audit_tag_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no audit tags at this moment." %}
+
+ {% endif %} {% endif %} diff --git a/base/templates/base/ticket_type/ticket_type.html b/base/templates/base/ticket_type/ticket_type.html index 26ad514da..b7f5239a2 100644 --- a/base/templates/base/ticket_type/ticket_type.html +++ b/base/templates/base/ticket_type/ticket_type.html @@ -1,6 +1,6 @@ {% extends 'settings.html' %} {% load i18n %} -{% block settings %} +{% block settings %}{% load static %}
{% if perms.helpdesk.view_tickettype %}
@@ -18,7 +18,14 @@ {% endif %}
- {% include 'base/ticket_type/ticket_type_view.html' %} + {% if ticket_types %} + {% include 'base/ticket_type/ticket_type_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no ticket types at this moment." %}
+
+ {% endif %} {% endif %}
diff --git a/base/templates/base/work_type/work_type.html b/base/templates/base/work_type/work_type.html index d7f556662..4ea39a41f 100644 --- a/base/templates/base/work_type/work_type.html +++ b/base/templates/base/work_type/work_type.html @@ -1,4 +1,4 @@ -{% extends 'settings.html' %} {% load i18n %} {% block settings %} +{% extends 'settings.html' %} {% load i18n %} {% block settings %} {% load static %}
{% if perms.base.view_worktype %}
{% endif %}
+ {% if jobs %} + {% include 'base/work_type/work_type_view.html' %} + {% else %} +
+ Page not found. 404. +
{% trans "There is no work types at this moment." %}
+
+ {% endif %} - {% endif %} {% include 'base/work_type/work_type_view.html' %} + {% endif %}
-

- {% trans "No shift requests have been created yet." %} -

+
+ {% trans "There are currently no shift requests to consider." %} +
diff --git a/base/templates/work_type_request/htmx/empty_request.html b/base/templates/work_type_request/htmx/empty_request.html index ea9e058c0..d3ab54cb4 100644 --- a/base/templates/work_type_request/htmx/empty_request.html +++ b/base/templates/work_type_request/htmx/empty_request.html @@ -8,9 +8,9 @@ src="{% static 'images/ui/no_request.png' %}" class="oh-404__image mb-4" /> -

- {% trans "No work type requests have been created yet." %} -

+
+ {% trans "There are currently no work type requests to consider." %} +
diff --git a/employee/filters.py b/employee/filters.py index 9789f5cf5..2f2dd3040 100644 --- a/employee/filters.py +++ b/employee/filters.py @@ -234,6 +234,9 @@ class EmployeeFilter(FilterSet): def __init__(self, data=None, queryset=None, *, request=None, prefix=None): super().__init__(data=data, queryset=queryset, request=request, prefix=prefix) self.form.fields["is_active"].initial = True + self.form.fields['email'].widget.attrs['autocomplete'] = 'email' + self.form.fields['phone'].widget.attrs['autocomplete'] = 'phone' + self.form.fields['country'].widget.attrs['autocomplete'] = 'country' for field in self.form.fields.keys(): self.form.fields[field].widget.attrs["id"] = f"{uuid.uuid4()}" self.model_choice_filters = [ diff --git a/employee/templates/dashboard/not_in_yet.html b/employee/templates/dashboard/not_in_yet.html index 267999482..f6a64b4f4 100644 --- a/employee/templates/dashboard/not_in_yet.html +++ b/employee/templates/dashboard/not_in_yet.html @@ -2,49 +2,57 @@
{% if employees.has_previous %} - - - - - {% endif %} - {% trans 'Not In Yet' %} - {% if employees.has_next %} - - + + + + {% endif %} + {% trans 'Not In Yet' %} + {% if employees.has_next %} + + - + {% endif %}
-
-
-
-
- {% for emp in employees %} -
-
-
-
- + {% if employees %} +
+
+
+
+ {% for emp in employees %} +
+
+
+
+ +
+ + {{ emp.get_full_name }} + {{ emp.get_leave_status }} +
- - {{ emp.get_full_name }} - {{ emp.get_leave_status }} - +
+
+
-
- -
-
- {% endfor %} + {% endfor %} +
+ {% else %} +
+
+ +

{% trans "No data Found..." %}

+
+ {% endif %}
diff --git a/employee/templates/dashboard/not_out_yet.html b/employee/templates/dashboard/not_out_yet.html index e766859f6..56d17f159 100644 --- a/employee/templates/dashboard/not_out_yet.html +++ b/employee/templates/dashboard/not_out_yet.html @@ -3,35 +3,45 @@
{% trans 'Not Out Yet' %}
-
-
-
-
- {% for emp in employees %} -
-
-
-
- + {% if employees %} +
+
+
+
+ {% for emp in employees %} +
+
+
+
+ +
+ + {{ emp.get_full_name }} + At work {{ emp.get_forecasted_at_work.forecasted_at_work }} + Pending {{ emp.get_forecasted_at_work.forecasted_pending_hours }} +
- - {{ emp.get_full_name }} - At work {{ emp.get_forecasted_at_work.forecasted_at_work }} - Pending {{ emp.get_forecasted_at_work.forecasted_pending_hours }} - +
+
+
-
- -
-
- {% endfor %} + {% endfor %} +
-
+ {% else %} +
+
+ +

{% trans "No data Found..." %}

+
+
+ {% endif %} +
diff --git a/employee/templates/disciplinary_actions/disciplinary_nav.html b/employee/templates/disciplinary_actions/disciplinary_nav.html index c8e36cfbb..97ae7ce5f 100644 --- a/employee/templates/disciplinary_actions/disciplinary_nav.html +++ b/employee/templates/disciplinary_actions/disciplinary_nav.html @@ -1,5 +1,6 @@ {% extends 'index.html' %} {% block content %} +{% load static %} {% load i18n %}
@@ -116,7 +117,7 @@
- + -
{% endif %}
- + {% if data %} +
+ {% include 'disciplinary_actions/disciplinary_records.html' %} +
+ {% else %} +
+ +
+
+ Page not found. 404. +
{% trans "There are currently no disciplinary actions to consider." %}
+
+
+
+ {% endif %} +