From b003aaee78c0c11d9097860fad52dcb3f78fd2fa Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 1 Nov 2023 12:06:04 +0530 Subject: [PATCH] [UPDT] BASE: Shift and work type request CRUD operation --- employee/templates/tabs/shift-tab.html | 1376 ++++++++++++++---------- 1 file changed, 809 insertions(+), 567 deletions(-) diff --git a/employee/templates/tabs/shift-tab.html b/employee/templates/tabs/shift-tab.html index 36ea9b365..cfa0aa1c6 100644 --- a/employee/templates/tabs/shift-tab.html +++ b/employee/templates/tabs/shift-tab.html @@ -1,498 +1,781 @@ -{% load i18n %} -{% load static %} +{% load i18n %} {% load static %} {% load basefilters %} {% load attendancefilters %}
-
-
    -
  • -
    - - {% trans "Work type request" %} -
    - -
  • -
  • -
    - - {% trans "Rotating work type" %} -
    - {% if not request.GET.profile %} - - {% endif%} -
  • -
  • -
    - - {% trans "Shift request" %} -
    - -
  • -
  • -
    - - {% trans "Rotating Shift" %} -
    - {% if not request.GET.profile %} - - {% endif %} -
  • -
-
-
- - {% if work_data %} -
-
-
-
-
-
-
- {% trans "Employee" %} -
-
-
-
{% trans "Requested Work Type" %}
-
{% trans "Previous/Current Work Type" %}
-
{% trans "Requested Date" %}
-
{% trans "Requested Till" %}
-
{% trans "Description" %}
-
- {% if not request.GET.profile %} -
-
- {% endif %} -
-
- {% for work_type_request in work_data %} -
-
-
-
-
-
- Username -
- {{work_type_request.employee_id}} -
-
-
-
{{work_type_request.work_type_id}}
-
{{work_type_request.previous_work_type_id}}
-
{{work_type_request.requested_date}}
-
{{work_type_request.requested_till}}
-
{{work_type_request.description}}
-
-
- {% if work_type_request.approved == False and not work_type_request.canceled %} - - {% endif %} - {% if work_type_request.approved == False %} -
- {% csrf_token %} - +
+
    +
  • +
    + + {% trans "Work type request" %} +
    + +
  • +
  • +
    + + {% trans "Rotating work type" %} +
    + {% if not request.GET.profile %} + + {% endif%} +
  • +
  • +
    + + {% trans "Shift request" %} +
    + +
  • +
  • +
    + + {% trans "Rotating Shift" %} +
    + {% if not request.GET.profile %} + + {% endif %} +
  • +
+
+
+ + {% if work_data %} +
+
+
+
+
+
+
+ {% trans "Employee" %} +
+
+
+
+ {% trans "Requested Work Type" %} +
+
+ {% trans "Previous/Current Work Type" %} +
+
+ {% trans "Requested Date" %} +
+
+ {% trans "Requested Till" %} +
+
{% trans "Description" %}
+
+ {% if not request.GET.profile %} +
+
+ {% endif %} +
+
+ {% for work_type_request in work_data %} +
+
+
+
+
+
+ Username +
+ {{work_type_request.employee_id}} +
+
+
+
+ {{work_type_request.work_type_id}} +
+
+ {{work_type_request.previous_work_type_id}} +
+
+ {{work_type_request.requested_date}} +
+
+ {{work_type_request.requested_till}} +
+
+ {{work_type_request.description}} +
+
+
+ {% if work_type_request.approved == False and not work_type_request.canceled %} + + {% else %} + + {% endif %} {% if work_type_request.approved == False %} + + {% csrf_token %} + - {% endif %} -
-
- {% if not request.GET.profile %} - -
- {% if work_type_request.approved == False %} - {% if perms.base.change_worktyperequest and work_type_request.approved == False or request.user|is_reportingmanager %} - {% if work_type_request.canceled %} - - {% elif request.user.employee_get == work_type_request.employee_id and not perms.base.change_worktyperequest %} - + {% else %} + + {% endif %} +
+
+ {% if not request.GET.profile %} + {% if perms.base.change_worktyperequest or request.user|is_reportingmanager %} +
+ {% if work_type_request.approved == False and work_type_request.canceled == False %} + + {% trans "Approve"%} + + {% else %} + + {% endif %} +
+
+ {% if work_type_request.canceled == False %} + + {% trans "Cancel" %} + {% else %} - {% trans "Approve" %} - - {% endif %} - {% endif %} - {% elif work_type_request.approved == True %} - - {% endif %} - - {% if not perms.base.change_worktyperequest and not request.user|is_reportingmanager and request.user == work_type_request.employee_id.employee_user_id %} - {% if work_type_request.canceled %} - - {% endif %} - {% endif %} -
-
- {% if work_type_request.approved == False and work_type_request.canceled == False %} - {% trans "Cancel" %} - {% endif %} -
- {% endif %} -
-
- {% endfor %} -
-
- {% else %} -
-
{% trans "No work type request has been created." %}
-
- {% endif %} -
-
- {% if rshift_assign %} -
-
-
-
-
-
-
- {% trans "Employee" %} -
-
-
-
{% trans "Title" %}
-
{% trans "Based On" %}
-
{% trans "Rotate" %}
-
{% trans "Start Date" %}
-
{% trans "Current Shift" %}
-
{% trans "Next Switch" %}
-
{% trans "Next Shift" %}
- {% if not request.GET.profile %} -
- {% endif %} -
-
-
- {% for rshift in rshift_assign %} -
-
-
-
-
- {% if rshift.employee_id.employee_profile %} - Username - {% else %} - Username - {% endif %} -
- {{rshift.employee_id}} -
-
-
-
{{rshift.rotating_shift_id}}
-
{{rshift.get_based_on_display }}
-
- {% if rshift.based_on == 'after' %} - {% trans "Rotate after" %} {{rshift.rotate_after_day}} {% trans "days" %} - {% elif rshift.based_on == "weekly" %} - {% trans "Weekly every" %} {{rshift.rotate_every_weekend}} - {% elif rshift.based_on == "monthly" %} - {% if rshift.rotate_every == "1" %} - {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "st day of month " %} - {% elif rshift.rotate_every == "2" %} - {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "nd day of month " %} - {% elif rshift.rotate_every == "3" %} - {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "rd day of month" %} - {% elif rshift.rotate_every == "last" %} - {% trans "Rotate every last day of month" %} - {% else %} - {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "th day of month " %} + + {% endif %} +
+ {% endif %} {% endif %} - {% endif %} -
-
{{rshift.start_date}}
-
{{rshift.current_shift}}
-
{{rshift.next_change_date}}
-
{{rshift.next_shift}}
- {% if not request.GET.profile %} -
-
- {% if perms.base.change_rotatingshiftassign or request.user|is_reportingmanager %} - - - {% endif %} - {% if perms.base.delete_rotatingshiftassign %} -
- {% csrf_token %} - -
- {% endif %} -
-
- {% endif %} -
- {% endfor %} -
-
-
- {% else %} -
-
{% trans "No rotating shift has been assigned." %}
-
- {% endif %} -
-
- {% if rwork_type_assign %} -
-
-
-
-
-
-
- {% trans "Employee" %} -
-
-
-
{% trans "Title" %}
-
{% trans "Based On" %}
-
{% trans "Rotate" %}
-
{% trans "Start Date" %}
-
{% trans "Current Work Type" %}
-
{% trans "Next Switch" %}
-
{% trans "Next Work Type" %}
- {% if not request.GET.profile %} -
- {% endif %} -
-
-
- {% for rwork_type in rwork_type_assign %} -
-
-
-
-
- {% if rwork_type.employee_id.employee_profile %} - Username - {% else %} - Username - {% endif %} -
- {{rwork_type.employee_id}} -
-
-
-
- {{rwork_type.rotating_work_type_id}} -
-
{{rwork_type.get_based_on_display}}
-
- {% if rwork_type.based_on == 'after' %} - {% trans "Rotate after " %}{{rwork_type.rotate_after_day}}{% trans " days" %} - {% elif rwork_type.based_on == "weekly" %} - {% trans "Weekly every " %}{{rwork_type.rotate_every_weekend}} - {% elif rwork_type.based_on == "monthly" %} - {% if rwork_type.rotate_every == "1" %} - {% trans "Rotate every " %}{{rwork_type.rotate_every}}{% trans "st day of month " %} - {% elif rwork_type.rotate_every == "2" %} - {% trans "Rotate every " %}{{rwork_type.rotate_every}}{% trans "nd day of month " %} - {% elif rwork_type.rotate_every == "3" %} - {% trans "Rotate every " %}{{rwork_type.rotate_every}}{% trans "rd day of month " %} - {% elif rwork_type.rotate_every == "last" %} - {% trans "Rotate every last day of month " %} - {% else %} - {% trans "Rotate every " %}{{rwork_type.rotate_every}}{% trans "th day of month " %} +
+
+ {% endfor %} +
+
+ {% else %} +
+
+ {% trans "No work type request has been created." %} +
+
+ {% endif %} +
+
+ {% if rshift_assign %} +
+
+
+
+
+
+
+ {% trans "Employee" %} +
+
+
+
{% trans "Title" %}
+
{% trans "Based On" %}
+
{% trans "Rotate" %}
+
+ {% trans "Start Date" %} +
+
+ {% trans "Current Shift" %} +
+
+ {% trans "Next Switch" %} +
+
{% trans "Next Shift" %}
+ {% if not request.GET.profile %} +
+ {% endif %} +
+
+
+ {% for rshift in rshift_assign %} +
+
+
+
+
+ {% if rshift.employee_id.employee_profile %} + Username + {% else %} + Username + {% endif %} +
+ {{rshift.employee_id}} +
+
+
+
+ {{rshift.rotating_shift_id}} +
+
+ {{rshift.get_based_on_display }} +
+
+ {% if rshift.based_on == 'after' %} + {% trans "Rotate after" %}{{rshift.rotate_after_day}}{% trans "days" %} + {% elif rshift.based_on == "weekly" %} + {% trans "Weekly every" %}{{rshift.rotate_every_weekend}} + {% elif rshift.based_on == "monthly" %} + {% if rshift.rotate_every == "1" %} + {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "st day of month " %} + {% elif rshift.rotate_every == "2" %} + {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "nd day of month " %} + {% elif rshift.rotate_every == "3" %} + {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "rd day of month" %} + {% elif rshift.rotate_every == "last" %} + {% trans "Rotate every last day of month" %} + {% else %} + {% trans "Rotate every " %}{{rshift.rotate_every}}{% trans "th day of month " %} + {% endif %} {% endif %} - {% endif %} -
-
{{rwork_type.start_date}}
-
{{rwork_type.current_work_type}}
-
{{rwork_type.next_change_date}}
-
{{rwork_type.next_work_type}}
- {% if not request.GET.profile %} -
-
- {% if perms.base.change_rotatingworktypeassign or request.user|is_reportingmanager %} - - - {% endif %} - {% if perms.base.delete_rotatingworktypeassign %} -
- {% csrf_token %} - -
- {% endif %} -
-
- {% endif %} -
- {% endfor %} -
-
-
- {% else %} -
-
{% trans "No rotating work type has been assigned." %}
-
- {% endif %} -
-
-
- {% if shift_data %} -
-
-
-
-
-
-
- {% trans "Employee" %} -
-
-
-
{% trans "Requested Shift" %}
-
{% trans "Previous/Current Shift" %}
-
{% trans "Requested Date" %}
-
{% trans "Requested Till" %}
-
{% trans "Description" %}
-
- {% if not request.GET.profile %} -
-
- {% endif %} -
-
- {% for shift_request in shift_data %} -
-
-
-
-
-
- Username -
- {{shift_request.employee_id}} -
-
-
-
{{shift_request.shift_id}}
-
{{shift_request.previous_shift_id}}
-
{{shift_request.requested_date}}
-
{{shift_request.requested_till}}
-
{{shift_request.description}}
-
-
- {% if shift_request.approved == False and not shift_request.canceled %} - - {% endif %} - {% if shift_request.approved == False %} -
- {% csrf_token %} - -
- {% endif %} -
-
- {% if not request.GET.profile %} -
- {% if shift_request.approved == False %} - {% if perms.base.change_shiftrequest and shift_request.approved == False or request.user|is_reportingmanager %} - {% if shift_request.canceled %} - - {% elif request.user.employee_get == shift_request.employee_id and not perms.base.change_shiftrequest %} - - {% else %} - {% trans "Approve" %} +
+
{{rshift.start_date}}
+
{{rshift.current_shift}}
+
+ {{rshift.next_change_date}} +
+
{{rshift.next_shift}}
+ {% if not request.GET.profile %} +
+
+ {% if perms.base.change_rotatingshiftassign or request.user|is_reportingmanager %} + + + {% endif %} + {% if perms.base.delete_rotatingshiftassign %} +
+ {% csrf_token %} + +
+ {% endif %} +
+
+ {% endif %} +
+ {% endfor %} +
+
+
+ {% else %} +
+
+ {% trans "No rotating shift has been assigned." %} +
+
+ {% endif %} +
+
+ {% if rwork_type_assign %} +
+
+
+
+
+
+
+ {% trans "Employee" %} +
+
+
+
{% trans "Title" %}
+
{% trans "Based On" %}
+
{% trans "Rotate" %}
+
+ {% trans "Start Date" %} +
+
+ {% trans "Current Work Type" %} +
+
+ {% trans "Next Switch" %} +
+
+ {% trans "Next Work Type" %} +
+ {% if not request.GET.profile %} +
+ {% endif %} +
+
+
+ {% for rwork_type in rwork_type_assign %} +
+
+
+
+
+ {% if rwork_type.employee_id.employee_profile %} + Username + {% else %} + Username + {% endif %} +
+ {{rwork_type.employee_id}} +
+
+
+
+ {{rwork_type.rotating_work_type_id}} +
+
+ {{rwork_type.get_based_on_display}} +
+
+ {% if rwork_type.based_on == 'after' %} + {% trans "Rotate after" %}{{rwork_type.rotate_after_day}}{% trans " days" %} + {% elif rwork_type.based_on == "weekly" %} + {% trans "Weekly every" %}{{rwork_type.rotate_every_weekend}} + {% elif rwork_type.based_on == "monthly" %} + {% if rwork_type.rotate_every == "1" %} + {% trans "Rotate every "%}{{rwork_type.rotate_every}}{% trans "st day of month " %} + {% elif rwork_type.rotate_every == "2" %} + {% trans "Rotate every" %}{{rwork_type.rotate_every}}{% trans "nd day of month " %} + {% elif rwork_type.rotate_every == "3" %} + {% trans "Rotate every " %}{{rwork_type.rotate_every}}{% trans "rd day of month" %} + {% elif rwork_type.rotate_every == "last" %} + {% trans "Rotate every last day of month " %} + {% else %} + {% trans "Rotate every " %}{{rwork_type.rotate_every}}{% trans "th day of month " %} + {% endif %} + {% endif %} +
+
{{rwork_type.start_date}}
+
+ {{rwork_type.current_work_type}} +
+
+ {{rwork_type.next_change_date}} +
+
+ {{rwork_type.next_work_type}} +
+ {% if not request.GET.profile %} +
+
+ {% if perms.base.change_rotatingworktypeassign or request.user|is_reportingmanager %} + + + {% endif %} + {% if perms.base.delete_rotatingworktypeassign %} +
+ {% csrf_token %} + +
+ {% endif %} +
+
+ {% endif %} +
+ {% endfor %} +
+
+
+ {% else %} +
+
+ {% trans "No rotating work type has been assigned." %} +
+
+ {% endif %} +
+
+
+ {% if shift_data %} +
+
+
+
+
+
+
+ {% trans "Employee" %} +
+
+
+
+ {% trans "Requested Shift" %} +
+
+ {% trans "Previous/Current Shift" %} +
+
+ {% trans "Requested Date" %} +
+
+ {% trans "Requested Till" %} +
+
{% trans "Description" %}
+
+ {% if not request.GET.profile %} +
+
+ {% endif %} +
+
+ {% for shift_request in shift_data %} +
+
+
+
+
+
+ Username +
+ {{shift_request.employee_id}} +
+
+
+
{{shift_request.shift_id}}
+
+ {{shift_request.previous_shift_id}} +
+
+ {{shift_request.requested_date}} +
+
+ {{shift_request.requested_till}} +
+
+ {{shift_request.description}} +
+
+
+ {% comment %} start of edit button {% endcomment %} + {% if shift_request.approved == False and not shift_request.canceled %} + + {% else %} + + {% endif %} {% comment %} end of edit button {% endcomment %} + {% if shift_request.approved == False %} +
+ {% csrf_token %} + +
+ {% else %} + + {% endif %} +
+
+ {% if not request.GET.profile %} + {% if perms.base.change_shiftrequest or request.user|is_reportingmanager %} +
+ {% if shift_request.approved == False and shift_request.canceled == False%} + + {% trans "Approve" %} + + {% else %} + + {% endif %} +
+
+ {% if shift_request.canceled == False %} + + {% trans "Cancel" %} + + {% else %} + + {% endif %} +
{% endif %} - {% endif %} - {% elif shift_request.approved == True %} - {% endif %} - - {% if not perms.base.change_shiftrequest and not request.user|is_reportingmanager and request.user == shift_request.employee_id.employee_user_id %} - {% if shift_request.canceled %} - - {% endif %} - {% endif %} -
-
- {% if shift_request.approved == False and shift_request.canceled == False %} - {% trans "Cancel" %} - {% endif %} -
- {% endif %} -
- -
- {% endfor %} -
-
- -
- - {% else %} -
-
{% trans "No Shift request has been created." %}
-
- {% endif %} - -
+
+ {% endfor %} +
+
+ {% else %} +
+
+ {% trans "No Shift request has been created." %} +
+
+ {% endif %} +
+
+
-
{% trans "Work type Request" %} +
+ {% trans "Work type Request" %} +
- -
-
-
+
@@ -552,19 +835,18 @@ >
-
{% trans "Update Shift Request" %} +
+ {% trans "Update Shift Request" %} +
- -
-
+ +
- +
{% trans "Rotating Shift Assign Update" %} -
-
-
+
-
-
{% trans "Work Type Request" %} -
- -
-
-
- {% include 'work_type_request/request_form.html' %} -
-
- -
- -
+ +
-
-
{% trans "Shift Request" %} -
- -
-
-
- -
-
- -
- +
+
@@ -682,13 +930,10 @@
-
- -
+
-
-

+

{% trans "Rotating Work Type Assign Update" %}