[UPDT] EMPLOYEE: 3 dot style and tick issue, penalty account in individual view, select all and policy visibility emp. instance, empty pages and form updation, bank form error updation

This commit is contained in:
Horilla
2024-04-08 15:14:18 +05:30
parent 7598c9029b
commit 27acbc4264
14 changed files with 537 additions and 310 deletions

View File

@@ -116,9 +116,17 @@ class EmployeeFilter(FilterSet):
# Getting the queryset for those employees dont have any attendance for the date
# in value.
queryset = queryset.exclude(
queryset1 = queryset.exclude(
employee_attendances__attendance_date=value,
)
queryset2 = queryset.filter(
employee_attendances__attendance_date=value,
employee_attendances__attendance_clock_out__isnull=False,
)
queryset = (queryset1 | queryset2).distinct()
return queryset
def not_out_yet_func(self, queryset, _, value):

View File

@@ -209,7 +209,7 @@ class Employee(models.Model):
elif self.employee_attendances.filter(
attendance_date=today,
).exists():
status = "Working"
status = "On a break"
return status
def get_forecasted_at_work(self):
@@ -629,7 +629,7 @@ class EmployeeBankDetails(models.Model):
def clean(self):
if self.account_number is not None:
bank_details = EmployeeBankDetails.objects.filter(
bank_details = EmployeeBankDetails.objects.exclude(employee_id=self.employee_id).filter(
account_number=self.account_number
)
if bank_details:

View File

@@ -71,6 +71,21 @@
{{form.gender}} {{form.gender.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.qualification.id_for_label}}"
>{% trans "Qualification" %}</label
>
{{form.qualification}}
{{form.qualification.errors}}
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.experience.id_for_label}}"
>{% trans "Experience" %}</label
>
{{form.experience}} {{form.experience.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12">
<label class="oh-label" for="address">{% trans "Address" %}</label>
@@ -139,29 +154,21 @@
{{form.emergency_contact_relation}}
{{form.emergency_contact_relation.errors}}
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="experience"
>{% trans "Experience" %}</label
>
{{form.experience}} {{form.experience.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="marital_status"
>{% trans "Maritial Status" %}</label
>
{{form.marital_status}} {{form.marital_status.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="children"
>{% trans "Children" %}</label
>
{{form.children}} {{form.children.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-2">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label me-2" for="isActive"
>{% trans "Is Active" %}?</label
>

View File

@@ -181,7 +181,7 @@
</div>
<div class="oh-table_sticky--wrapper">
<div class="oh-sticky-dropdown--header">
<div class="oh-sticky-dropdown--header" style="border:none;">
<div class="oh-dropdown" x-data="{open: false}">
<button class="oh-sticky-dropdown_btn " @click="open = !open"><ion-icon name="ellipsis-vertical-sharp"
role="img" class="md hydrated" aria-label="ellipsis vertical sharp"></ion-icon></button>

View File

@@ -80,6 +80,21 @@
{{form.gender}} {{form.gender.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.qualification.id_for_label}}"
>{% trans "Qualification" %}</label
>
{{form.qualification}}
{{form.qualification.errors}}
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.experience.id_for_label}}"
>{% trans "Experience" %}</label
>
{{form.experience}} {{form.experience.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12">
<label class="oh-label" for="{{form.address.id_for_label}}">{% trans "Address" %}</label>
@@ -156,29 +171,22 @@
{{form.emergency_contact_relation}}
{{form.emergency_contact_relation.errors}}
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.experience.id_for_label}}"
>{% trans "Experience" %}</label
>
{{form.experience}} {{form.experience.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.marital_status.id_for_label}}"
>{% trans "Maritial Status" %}</label
>
{{form.marital_status}} {{form.marital_status.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label d-block" for="{{form.children.id_for_label}}"
>{% trans "Children" %}</label
>
{{form.children}} {{form.children.errors}}
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-2">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label me-2" for="{{form.is_active.id_for_label}}"
>{% trans "Is Active" %}?</label
>

View File

@@ -226,7 +226,7 @@
<div class="oh-table_sticky--wrapper">
{% if request.user.is_superuser or request.user|check_manager:employee or request.user == employee.employee_user_id %}
<div class="oh-sticky-dropdown--header">
<div class="oh-sticky-dropdown--header" style="border:none;">
<div class="oh-dropdown" x-data="{open: false}">
<button class="oh-sticky-dropdown_btn " @click="open = !open"><ion-icon name="ellipsis-vertical-sharp"
role="img" class="md hydrated" aria-label="ellipsis vertical sharp"></ion-icon></button>
@@ -315,6 +315,18 @@
>
</li>
{% endif %}
{% if perms.attendance.view_penaltyaccount or request.user == employee.employee_user_id %}
<li data-cell-index="23" data-cell-title="{% trans "Penalty Account" %}" class="oh-general__tab">
<a
data-action="general-tab"
data-target="#penaltyTarget"
id="penalty"
class="oh-general__tab-link"
role="button"
>{% trans "Penalty Account" %}</a
>
</li>
{% endif %}
{% comment %} <li class="oh-general__tab">
<a
href="#"
@@ -409,6 +421,7 @@
class="oh-general__tab-link"
data-action="general-tab"
data-target="#maillog"
role="button"
>{% trans "Mail Log" %}</a
>
</li>
@@ -475,6 +488,13 @@
>
</div>
<div
class="oh-general__tab-target oh-profile__info-tab mb-4"
id="penaltyTarget"
>
{% include 'tabs/penalty_account.html' %}
</div>
<div
class="oh-general__tab-target oh-profile__info-tab mb-4 d-none"
id="performance_target"
@@ -550,7 +570,11 @@
$("#view-container").find(".oh-general__tab-link")[0].click()
}
});
toggleColumns("employee-tab","fieldContainerTable")
if (!localStorage.getItem("employee_tab")) {
$("#fieldContainerTable").find("[type=checkbox]").prop("checked",true).change()
}
</script>
<script>

View File

@@ -247,7 +247,7 @@
{% if perms.employee.delete_employee %}
{% if emp.is_active %}
<button hx-confirm="{% trans 'Do you want to archive this employee?' %}" hx-post="{% url 'employee-archive' emp.id %}?{{pd}}"
hx-target="#relatedModel" class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100">
hx-target="#relatedModel" class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100" title="{% trans 'Archive' %}">
<ion-icon name="archive"></ion-icon>
</button>
{% else %}

View File

@@ -6,7 +6,9 @@
<div class="oh-alert oh-alert--animated {{message.tags}}">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% if perms.employee.view_employee or request.user|is_reportingmanager %}
<div
class="oh-checkpoint-badge text-success mb-2"
id="selectAllEmployees"
@@ -28,6 +30,8 @@
>
{% trans "Export Employees" %}
</div>
{% endif %}
<span name="" id="filterEmployee" style="display: none" hx-get="{% url 'employee-filter-view' %}?{{pd}}" hx-target="#view-container"></span>
<div id="relatedModel"></div>
<div class="oh-checkpoint-badge text-danger mb-2" id="selectedShow"></div>

View File

@@ -2,15 +2,23 @@
<form hx-post="{% url 'add-attachment-policy' %}?policy_id={{policy.id}}" hx-target="#attachmentContainer" class="add-files-form d-flex" method="post"
hx-encoding="multipart/form-data">
{% for attachment in policy.attachments.all %}
<a href="{{ attachment.attachment.url }}" rel="noopener noreferrer" target="_blank"><span
class="oh-file-icon oh-file-icon--pdf" onmouseover="enlargeImage('{{ attachment.attachment.url }}')"
style="width:40px;height:40px"><img src="{% static '/images/ui/minus-icon.png' %}"
style="display:block;width:50%;height:50%"
hx-get="{% url 'remove-attachment-policy' %}?ids={{ attachment.id }}&policy_id={{ policy.id }}"
hx-target="#attachmentContainer"
onclick="event.stopPropagation();event.preventDefault()" />
</span>
</a>
{% if perms.employee.delete_policy %}
<a href="{{ attachment.attachment.url }}" rel="noopener noreferrer" target="_blank"><span
class="oh-file-icon oh-file-icon--pdf" onmouseover="enlargeImage('{{ attachment.attachment.url }}')"
style="width:40px;height:40px"><img src="{% static '/images/ui/minus-icon.png' %}"
style="display:block;width:50%;height:50%"
hx-get="{% url 'remove-attachment-policy' %}?ids={{ attachment.id }}&policy_id={{ policy.id }}"
hx-target="#attachmentContainer"
onclick="event.stopPropagation();event.preventDefault()" />
</span>
</a>
{% else %}
<a href="{{ attachment.attachment.url }}" rel="noopener noreferrer" target="_blank"><span
class="oh-file-icon oh-file-icon--pdf" onmouseover="enlargeImage('{{ attachment.attachment.url }}')"
style="width:40px;height:40px">
</span>
</a>
{% endif %}
{% endfor %}
{% if perms.employee.add_policy %}

View File

@@ -23,9 +23,9 @@
</h3>
<div style="max-height: 350px;overflow: hidden;min-height:100px; overflow-y:auto;" class="truncated-text">{{ policy.body|safe }}</div>
</div>
{% if perms.recruitment.change_recruitmentmailtemplate %}
<a hx-get="{% url 'view-policy' %}?instance_id={{ policy.id }}" hx-target="#policyModalBody" data-toggle="oh-modal-toggle" data-target="#policyModal" class="oh-btn oh-btn--secondary oh-btn--block">{% trans 'View policy' %}</a>
{% endif %}
<a hx-get="{% url 'view-policy' %}?instance_id={{ policy.id }}" hx-target="#policyModalBody" data-toggle="oh-modal-toggle" data-target="#policyModal" class="oh-btn oh-btn--secondary oh-btn--block">{% trans 'View policy' %}</a>
</div>
{% endfor %}
</div>

View File

@@ -222,121 +222,127 @@
</div>
{% endif %}
</div>
<div class="oh-tabs__content" id="attendance_tab_3">
<div class="oh-sticky-table">
<div class="oh-sticky-table__table oh-table--sortable">
<div class="oh-sticky-table__thead">
<div class="oh-sticky-table__tr">
<div class="oh-sticky-table__th" >
<div class="d-flex">
<div hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=employee_id__employee_first_name" hx-target="#tab_contents">
{% trans "Employee" %}
</div>
</div>
</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=attendance_date" hx-target="#tab_contents">{% trans "Date" %}</div>
<div class="oh-sticky-table__th">{% trans "Day" %}</div>
<div class="oh-sticky-table__th" >{% trans "Check-In" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=attendance_clock_in_date" hx-target="#tab_contents">{% trans "In Date" %}</div>
<div class="oh-sticky-table__th">{% trans "Check-Out" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=attendance_clock_out_date" hx-target="#tab_contents">{% trans "Out Date" %}</div>
<div class="oh-sticky-table__th">{% trans "Shift" %}</div>
<div class="oh-sticky-table__th">{% trans "Work Type" %}</div>
<div class="oh-sticky-table__th" >{% trans "Min Hour" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=at_work_second" hx-target="#tab_contents">{% trans "At Work" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=overtime_second" hx-target="#tab_contents">{% trans "Overtime" %}</div>
<div class="oh-sticky-table__th"></div>
<div class="oh-sticky-table__th"></div>
</div>
</div>
{% for attendance in validate_attendances %}
<div class="oh-sticky-table__tbody">
<div class="oh-sticky-table__tr"
draggable="false"
data-toggle="oh-modal-toggle"
data-target="#objectDetailsModalW25"
hx-target="#objectDetailsModalW25Target"
hx-get="{% url 'user-request-one-view' attendance.id %}?validate=true&instances_ids={{validate_attendances_ids}}">
<div class="oh-sticky-table__sd">
<div class="d-flex">
<div class="oh-profile oh-profile--md">
<div class="oh-profile__avatar mr-1">
<img
src="https://ui-avatars.com/api/?name={{attendance.employee_id.employee_first_name}}+{{attendance.employee_id.employee_last_name}}&background=random"
class="oh-profile__image"
alt="Mary Magdalene"
/>
{% if validate_attendances %}
<div class="oh-tabs__content" id="attendance_tab_3">
<div class="oh-sticky-table">
<div class="oh-sticky-table__table oh-table--sortable">
<div class="oh-sticky-table__thead">
<div class="oh-sticky-table__tr">
<div class="oh-sticky-table__th" >
<div class="d-flex">
<div hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=employee_id__employee_first_name" hx-target="#tab_contents">
{% trans "Employee" %}
</div>
</div>
<span class="oh-profile__name oh-text--dark"
>{{attendance.employee_id}}</span
>
</div>
</div>
</div>
<div class="oh-sticky-table__td dateformat_changer">
{{attendance.attendance_date}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_day.get_day_display }}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_clock_in}}
</div>
<div class="oh-sticky-table__td dateformat_changer">
{{attendance.attendance_clock_in_date}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_clock_out}}
</div>
<div class="oh-sticky-table__td dateformat_changer">
{{attendance.attendance_clock_out_date}}
</div>
<div class="oh-sticky-table__td">{{attendance.shift_id}}</div>
<div class="oh-sticky-table__td">
{{attendance.work_type_id}}
</div>
<div class="oh-sticky-table__td">
{{attendance.minimum_hour}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_worked_hour}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_overtime}}
</div>
<div class="oh-sticky-table__td" onclick="event.stopPropagation();">
<div class="oh-btn-group">
{% if perms.attendance.change_attendance or request.user|is_reportingmanager %}
<a hx-get="{% url 'attendance-update' attendance.id %}" hx-target='#updateAttendanceRequestModalBody' hx-swap='innerHTML' data-toggle='oh-modal-toggle' data-target='#updateAttendanceRequest' class="oh-btn oh-btn--light-bkg w-50" title="{% trans 'Edit' %}"><ion-icon name="create-outline"></ion-icon></a>
{% endif %}
{% if perms.attendance.delete_attendance %}
<form action="{% url 'attendance-delete' attendance.id %}" onsubmit="return confirm('{% trans "Are you sure want to delete this attendance?" %}')" hx-target="#tab_contents" method='post' class='w-50'>
{% csrf_token %}
<button type='submit' class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100" title="{% trans 'Remove' %}"><ion-icon name="trash-outline"></ion-icon></button>
</form>
{% endif %}
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=attendance_date" hx-target="#tab_contents">{% trans "Date" %}</div>
<div class="oh-sticky-table__th">{% trans "Day" %}</div>
<div class="oh-sticky-table__th" >{% trans "Check-In" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=attendance_clock_in_date" hx-target="#tab_contents">{% trans "In Date" %}</div>
<div class="oh-sticky-table__th">{% trans "Check-Out" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=attendance_clock_out_date" hx-target="#tab_contents">{% trans "Out Date" %}</div>
<div class="oh-sticky-table__th">{% trans "Shift" %}</div>
<div class="oh-sticky-table__th">{% trans "Work Type" %}</div>
<div class="oh-sticky-table__th" >{% trans "Min Hour" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=at_work_second" hx-target="#tab_contents">{% trans "At Work" %}</div>
<div class="oh-sticky-table__th" hx-get="{% url 'attendance-search' %}?{{pd}}&sortby=overtime_second" hx-target="#tab_contents">{% trans "Overtime" %}</div>
<div class="oh-sticky-table__th"></div>
<div class="oh-sticky-table__th"></div>
</div>
</div>
<div class="oh-sticky-table__td" onclick="event.stopPropagation();">
{% if request.user|is_reportingmanager or perms.attendance.change_attendance %}
<a
href = '{% url "validate-this-attendance" attendance.id %}'
hx-target='#updateAttendanceBody'
class="oh-btn oh-btn--info">
{% trans "Validate" %}
</a>
{% endif %}
</div>
{% for attendance in validate_attendances %}
<div class="oh-sticky-table__tbody">
<div class="oh-sticky-table__tr"
draggable="false"
data-toggle="oh-modal-toggle"
data-target="#objectDetailsModalW25"
hx-target="#objectDetailsModalW25Target"
hx-get="{% url 'user-request-one-view' attendance.id %}?validate=true&instances_ids={{validate_attendances_ids}}">
<div class="oh-sticky-table__sd">
<div class="d-flex">
<div class="oh-profile oh-profile--md">
<div class="oh-profile__avatar mr-1">
<img
src="https://ui-avatars.com/api/?name={{attendance.employee_id.employee_first_name}}+{{attendance.employee_id.employee_last_name}}&background=random"
class="oh-profile__image"
alt="Mary Magdalene"
/>
</div>
<span class="oh-profile__name oh-text--dark"
>{{attendance.employee_id}}</span
>
</div>
</div>
</div>
<div class="oh-sticky-table__td dateformat_changer">
{{attendance.attendance_date}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_day.get_day_display }}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_clock_in}}
</div>
<div class="oh-sticky-table__td dateformat_changer">
{{attendance.attendance_clock_in_date}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_clock_out}}
</div>
<div class="oh-sticky-table__td dateformat_changer">
{{attendance.attendance_clock_out_date}}
</div>
<div class="oh-sticky-table__td">{{attendance.shift_id}}</div>
<div class="oh-sticky-table__td">
{{attendance.work_type_id}}
</div>
<div class="oh-sticky-table__td">
{{attendance.minimum_hour}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_worked_hour}}
</div>
<div class="oh-sticky-table__td">
{{attendance.attendance_overtime}}
</div>
<div class="oh-sticky-table__td" onclick="event.stopPropagation();">
<div class="oh-btn-group">
{% if perms.attendance.change_attendance or request.user|is_reportingmanager %}
<a hx-get="{% url 'attendance-update' attendance.id %}" hx-target='#updateAttendanceRequestModalBody' hx-swap='innerHTML' data-toggle='oh-modal-toggle' data-target='#updateAttendanceRequest' class="oh-btn oh-btn--light-bkg w-50" title="{% trans 'Edit' %}"><ion-icon name="create-outline"></ion-icon></a>
{% endif %}
{% if perms.attendance.delete_attendance %}
<form action="{% url 'attendance-delete' attendance.id %}" onsubmit="return confirm('{% trans "Are you sure want to delete this attendance?" %}')" hx-target="#tab_contents" method='post' class='w-50'>
{% csrf_token %}
<button type='submit' class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100" title="{% trans 'Remove' %}"><ion-icon name="trash-outline"></ion-icon></button>
</form>
{% endif %}
</div>
</div>
<div class="oh-sticky-table__td" onclick="event.stopPropagation();">
{% if request.user|is_reportingmanager or perms.attendance.change_attendance %}
<a
href = '{% url "validate-this-attendance" attendance.id %}'
hx-target='#updateAttendanceBody'
class="oh-btn oh-btn--info">
{% trans "Validate" %}
</a>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% else %}
<div class="d-flex justify-content-center align-items-center" style="height:40vh">
<h5 class="oh-404__subtitle">{% trans "No attendance requests to validate." %}</h5>
</div>
{% endif %}
</div>
</div>
</div>

View File

@@ -1,66 +1,76 @@
{% load static %}
{% load static %} {% load i18n %}
{% load audit_filters %}
<div class="row">
{% for history in employee.employee_work_info.tracking %}
<div class="oh-history__container">
<div class="oh-history_date oh-card__title oh-card__title--sm fw-bold me-2">
<span class="oh-history_date-content">
<span class="dateformat_changer">{{ history.pair.1.history_date|date:"M. d, Y" }}</span>&nbsp,&nbsp
<span class="timeformat_changer">{{ history.pair.1.history_date|date:"g:i A" }}</span>
</span>
</div>
<div class="d-flex">
<div class="oh-history_user-img">
<img
src="{{history.updated_by.get_avatar}}"
alt=""
class="oh-history_user-pic"
/>
<div class="oh-history_user-state oh-user_inactive"></div>
</div>
<div class="oh-history_user-details">
<span class="oh-history__username ">{{history.updated_by}}</span>
<div class="oh-history_abt pb-0">
{% if history.pair.0.history_title %}
<span class="oh-history_task-state">{{history.pair.0.history_title}}</span>
{% endif %}
{% if history.pair.0.history_description %}
<p class="oh-history_time">
{{history.pair.0.history_description}}
</p>
{% endif %}
<div class="oh-history_tabs">
{% for tag in history.pair.0.history_tags.all %}
<a href="#" class="oh-history_msging-email oh-history_tabs-items"
>{{tag.title}}</a
>
{% endfor %}
</div>
{% if history %}
{% for history in employee.employee_work_info.tracking %}
<div class="oh-history__container">
<div class="oh-history_date oh-card__title oh-card__title--sm fw-bold me-2">
<span class="oh-history_date-content">
<span class="dateformat_changer">{{ history.pair.1.history_date|date:"M. d, Y" }}</span>&nbsp,&nbsp
<span class="timeformat_changer">{{ history.pair.1.history_date|date:"g:i A" }}</span>
</span>
</div>
<div class="oh-history_msg-container">
<div class="oh-history_task-tracker">
<span class="oh-history_msging-email">{{history.type}}</span>
<ul class="ul">
{% for change in history.changes %}
<li class="oh-history_task-list">
<div class="oh-history_track-value">
<span >{{history.pair.1|fk_history:change}}</span>
<img
src="{% static '/images/ui/arrow-right-line.svg' %}"
class="oh-progress_arrow"
alt=""
/>
<span class="oh-history_tracking-value">{{history.pair.0|fk_history:change}}</span>
<span class="oh-history-task-state"><i>({{change.field}})</i></span>
</div>
</li>
{% endfor %}
</ul>
<div class="d-flex">
<div class="oh-history_user-img">
<img
src="{{history.updated_by.get_avatar}}"
alt=""
class="oh-history_user-pic"
/>
<div class="oh-history_user-state oh-user_inactive"></div>
</div>
<div class="oh-history_user-details">
<span class="oh-history__username ">{{history.updated_by}}</span>
<div class="oh-history_abt pb-0">
{% if history.pair.0.history_title %}
<span class="oh-history_task-state">{{history.pair.0.history_title}}</span>
{% endif %}
{% if history.pair.0.history_description %}
<p class="oh-history_time">
{{history.pair.0.history_description}}
</p>
{% endif %}
<div class="oh-history_tabs">
{% for tag in history.pair.0.history_tags.all %}
<a href="#" class="oh-history_msging-email oh-history_tabs-items"
>{{tag.title}}</a
>
{% endfor %}
</div>
</div>
<div class="oh-history_msg-container">
<div class="oh-history_task-tracker">
<span class="oh-history_msging-email">{{history.type}}</span>
<ul class="ul">
{% for change in history.changes %}
<li class="oh-history_task-list">
<div class="oh-history_track-value">
<span >{{history.pair.1|fk_history:change}}</span>
<img
src="{% static '/images/ui/arrow-right-line.svg' %}"
class="oh-progress_arrow"
alt=""
/>
<span class="oh-history_tracking-value">{{history.pair.0|fk_history:change}}</span>
<span class="oh-history-task-state"><i>({{change.field}})</i></span>
</div>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div
class="d-flex justify-content-center align-items-center"
style="height: 40vh"
>
<h5 class="oh-404__subtitle">{% trans "No history found." %}</h5>
</div>
</div>
{% endfor %}
{% endif %}
</div>

View File

@@ -15,7 +15,12 @@
<ion-icon name="calendar-outline"></ion-icon>
<span>{% trans "Date of Birth" %}</span>
</span>
<span class="oh-profile__info-value dateformat_changer">{{employee.dob}}</span>
{% if employee.dob %}
<span class="oh-profile__info-value dateformat_changer">{{employee.dob}}</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
@@ -31,89 +36,131 @@
<ion-icon name="home-outline"></ion-icon>
<span>{% trans "Address" %}</span>
</span>
<p class="oh-profile__info-value mb-0">{{employee.address}}</p>
{% if employee.address %}
<span class="oh-profile__info-value mb-0">{{employee.address}}</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="flag-outline"></ion-icon>
<span>{% trans "Country" %}</span>
</span>
<span class="oh-profile__info-value"> {{employee.country}} </span>
{% if employee.country %}
<span class="oh-profile__info-value"> {{employee.country}} </span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="compass-outline"></ion-icon>
<span>{% trans "State" %}</span>
</span>
<span class="oh-profile__info-value"> {{employee.state}} </span>
{% if employee.state %}
<span class="oh-profile__info-value"> {{employee.state}} </span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="planet-outline"></ion-icon>
<span>{% trans "City" %}</span>
</span>
<span class="oh-profile__info-value"> {{employee.city}} </span>
{% if employee.city %}
<span class="oh-profile__info-value"> {{employee.city}}</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="book-outline"></ion-icon>
<span>{% trans "Qualification" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.qualification}}
</span>
{% if employee.qualification %}
<span class="oh-profile__info-value">{{employee.qualification}}</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="briefcase-outline"></ion-icon>
<span>{% trans "Experience" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.experience}}
</span>
{% if employee.experience %}
<span class="oh-profile__info-value">{{employee.experience}}</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="link-outline"></ion-icon>
<span>{% trans "Maritial Status" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.get_marital_status_display}}</span
>
<span class="oh-profile__info-value">{{employee.get_marital_status_display}}</span>
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="person-circle-outline"></ion-icon>
<span>{% trans "Children" %}</span>
</span>
<span class="oh-profile__info-value"> {{employee.children}} </span>
{% if employee.children %}
<span class="oh-profile__info-value"> {{employee.children}} </span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="call-outline"></ion-icon>
<span>{% trans "Emergency Contact" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.emergency_contact}}
</span>
{% if employee.emergency_contact %}
<span class="oh-profile__info-value">{{employee.emergency_contact}}</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="people-circle-outline"></ion-icon>
<span>{% trans "Emergency Contact Name" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.emergency_contact_name}}
</span>
{% if employee.emergency_contact_name %}
<span class="oh-profile__info-value">
{{employee.emergency_contact_name}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="finger-print-outline"></ion-icon>
<span>{% trans "Emergency Contact Relation" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.emergency_contact_relation}}
</span>
{% if employee.emergency_contact_relation %}
<span class="oh-profile__info-value">
{{employee.emergency_contact_relation}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
</ul>
</div>
@@ -163,18 +210,28 @@
<ion-icon name="construct-outline"></ion-icon>
<span>{% trans "Department" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.department_id}}</span
>
{% if employee.employee_work_info.department_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.department_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="time-outline"></ion-icon>
<span>{% trans "Shift Information" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.shift_id}}</span
>
{% if employee.employee_work_info.shift_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.shift_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
@@ -182,9 +239,14 @@
<ion-icon name="briefcase-outline"></ion-icon>
<span>{% trans "Employee Type" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.employee_type_id}}</span
>
{% if employee.employee_work_info.employee_type_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.employee_type_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
@@ -192,9 +254,14 @@
<ion-icon name="person-circle-outline"></ion-icon>
<span>{% trans "Reporting Manager" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.reporting_manager_id}}</span
>
{% if employee.employee_work_info.reporting_manager_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.reporting_manager_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
@@ -202,18 +269,28 @@
<ion-icon name="business-outline"></ion-icon>
<span>{% trans "Work Location" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.location}}</span
>
{% if employee.employee_work_info.location %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.location}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="calendar-outline"></ion-icon>
<span>{% trans "End Date" %}</span>
</span>
<span class="oh-profile__info-value dateformat_changer"
>{{employee.employee_work_info.contract_end_date}}</span
>
{% if employee.employee_work_info.contract_end_date %}
<span class="oh-profile__info-value dateformat_changer"
>{{employee.employee_work_info.contract_end_date}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
</ul>
</div>
@@ -225,42 +302,62 @@
<ion-icon name="briefcase-outline"></ion-icon>
<span>{% trans "Job Position" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.job_position_id}}</span
>
{% if employee.employee_work_info.job_position_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.job_position_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="time-outline"></ion-icon>
<span>{% trans "Work Type" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.work_type_id}}</span
>
{% if employee.employee_work_info.work_type_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.work_type_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="cash-outline"></ion-icon>
<span>{% trans "Salary" %}</span>
</span>
<span class="oh-profile__info-value"
{% if employee.employee_work_info.basic_salary %}
<span class="oh-profile__info-value"
>
{% if perms.employee.view_employee or request.user == employee.employee_user_id %}
{{employee.employee_work_info.basic_salary}}
{% else %}
**********
{% endif %}
</span
>
{% if perms.employee.view_employee or request.user == employee.employee_user_id %}
{{employee.employee_work_info.basic_salary}}
{% else %}
**********
{% endif %}
</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="business-outline"></ion-icon>
<span>{% trans "Company" %}</span>
</span>
<span class="oh-profile__info-value"
>{{employee.employee_work_info.company_id}}</span
>
{% if employee.employee_work_info.company_id %}
<span class="oh-profile__info-value"
>{{employee.employee_work_info.company_id}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
@@ -268,9 +365,15 @@
<ion-icon name="calendar-outline"></ion-icon>
<span>{% trans "Joining Date" %}</span>
</span>
<span class="oh-profile__info-value dateformat_changer"
>{{employee.employee_work_info.date_joining}}</span
>
{% if employee.employee_work_info.date_joining %}
<span class="oh-profile__info-value dateformat_changer"
>{{employee.employee_work_info.date_joining}}</span
>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
@@ -279,13 +382,18 @@
<span>{% trans "Tags" %}</span>
</span>
<div style= "display: flex; flex-wrap: wrap;">
{% for i in employee.employee_work_info.tags.all %}
{% with tag_width=i.title|length %}
<span class="oh-profile__info-value mt-1 mb-1 mr-1" style="background-color: {{ i.color }};
font-size: .8rem; padding: 4px 10px; border-radius: 18px; font-weight: 600; width: {{ tag_width }}em;"
>{{ i.title }}</span>
{% endwith %}
{% endfor %}
{% if employee.employee_work_info.tags.all %}
{% for i in employee.employee_work_info.tags.all %}
{% with tag_width=i.title|length %}
<span class="oh-profile__info-value mt-1 mb-1 mr-1" style="background-color: {{ i.color }};
font-size: .8rem; padding: 4px 10px; border-radius: 18px; font-weight: 600; width: {{ tag_width }}em;"
>{{ i.title }}</span>
{% endwith %}
{% endfor %}
{% else %}
<span class="oh-profile__info-value dateformat_changer"
>{% trans "None" %}</span>
{% endif %}
</div>
</li>
@@ -320,36 +428,56 @@
<ion-icon name="business-outline"></ion-icon>
<span>{% trans "Bank Name" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.bank_name}}
</span>
{% if employee.employee_bank_details.bank_name %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.bank_name}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="location-outline"></ion-icon>
<span>{% trans "Branch" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.branch}}
</span>
{% if employee.employee_bank_details.branch %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.branch}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="map-outline"></ion-icon>
<span>{% trans "Bank Address" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.address}}
</span>
{% if employee.employee_bank_details.address %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.address}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="information-outline"></ion-icon>
<span>{% trans "Bank Code" %} #1</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.any_other_code1}}
</span>
{% if employee.employee_bank_details.any_other_code1 %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.any_other_code1}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
</ul>
</div>
@@ -360,27 +488,42 @@
<ion-icon name="information-circle-outline"></ion-icon>
<span>{% trans "Account Number" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.account_number}}
</span>
{% if employee.employee_bank_details.account_number %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.account_number}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="information-outline"></ion-icon>
<span>{% trans "Bank Code" %} #2</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.any_other_code2}}
</span>
{% if employee.employee_bank_details.any_other_code2 %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.any_other_code2}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
<li class="oh-profile__card-info-item">
<span class="oh-profile__info-label mb-1">
<ion-icon name="flag-outline"></ion-icon>
<span>{% trans "Country" %}</span>
</span>
<span class="oh-profile__info-value">
{{employee.employee_bank_details.country}}
</span>
{% if employee.employee_bank_details.country %}
<span class="oh-profile__info-value">
{{employee.employee_bank_details.country}}
</span>
{% else %}
<span class="oh-profile__info-value"
>{% trans "None" %}</span>
{% endif %}
</li>
</ul>
</div>

View File

@@ -671,9 +671,10 @@
</button>
{% endif %} {% comment %} end of edit button {% endcomment %}
{% if shift_request.approved == False %}
<form action="{% url 'shift-request-delete' shift_request.id %}"
onsubmit="return confirm('{% trans "Are you sure you want to delete this shift request?" %}');"
method='post'
<form
hx-confirm="{% trans "Are you sure you want to delete this shift request?" %}"
hx-post="{% url 'shift-request-delete' shift_request.id %}"
hx-target="#shift_target"
class="w-50"
>
{% csrf_token %}
@@ -831,13 +832,21 @@
<script>
$(document).ready(function () {
$(".oh-tabs__tab[data-target]").click(function (e) {
e.preventDefault();
var newActiveTab = $(this).attr("data-target");
$(".oh-tabs__content--active").toggleClass("oh-tabs__content--active");
$(".oh-tabs__tab--active").toggleClass("oh-tabs__tab--active");
$(`[data-target="${newActiveTab}"]`).toggleClass("oh-tabs__tab--active");
$(newActiveTab).toggleClass("oh-tabs__content--active");
});
});
const activeTab = localStorage.getItem('EmployeeShiftActiveTab')
if (activeTab!=null) {
$(".oh-tabs__content--active").toggleClass('oh-tabs__content--active');
$(".oh-tabs__tab--active").toggleClass('oh-tabs__tab--active');
$(`[data-target="${activeTab}"]`).toggleClass("oh-tabs__tab--active");
$(activeTab).toggleClass("oh-tabs__content--active");
}
$(".oh-tabs__tab[data-target]").click(function (e) {
e.preventDefault();
localStorage.setItem("EmployeeShiftActiveTab",$(this).attr('data-target'))
var newActiveTab = $(this).attr('data-target')
$(".oh-tabs__content--active").toggleClass('oh-tabs__content--active');
$(".oh-tabs__tab--active").toggleClass('oh-tabs__tab--active');
$(`[data-target="${newActiveTab}"]`).toggleClass("oh-tabs__tab--active");
$(newActiveTab).toggleClass("oh-tabs__content--active");
});
});
</script>