diff --git a/recruitment/admin.py b/recruitment/admin.py index 50d48a04c..ce01e8b84 100644 --- a/recruitment/admin.py +++ b/recruitment/admin.py @@ -6,6 +6,7 @@ This page is used to register the model with admins site. from django.contrib import admin from recruitment.models import ( CandidateRating, + SkillZone, Stage, Recruitment, Candidate, @@ -25,3 +26,4 @@ admin.site.register(RecruitmentSurveyAnswer) admin.site.register(RecruitmentSurvey) admin.site.register(RecruitmentMailTemplate) admin.site.register(CandidateRating) +admin.site.register(SkillZone) diff --git a/recruitment/filters.py b/recruitment/filters.py index af523c0bc..3a761d505 100644 --- a/recruitment/filters.py +++ b/recruitment/filters.py @@ -479,6 +479,7 @@ class SkillZoneCandFilter(FilterSet): model = SkillZoneCandidate fields = [ + "is_active", "candidate_id", "candidate_id__recruitment_id", "candidate_id__stage_id", diff --git a/recruitment/forms.py b/recruitment/forms.py index fa208a056..3ee34c32a 100644 --- a/recruitment/forms.py +++ b/recruitment/forms.py @@ -825,6 +825,7 @@ class SkillZoneCreateForm(ModelForm): "created_on", "objects", "company_id", + "is_active", ] def as_p(self, *args, **kwargs): @@ -853,6 +854,7 @@ class SkillZoneCandidateForm(ModelForm): fields = "__all__" exclude = [ "added_on", + "is_active", ] def as_p(self, *args, **kwargs): diff --git a/recruitment/templates/dashboard/dashboard.html b/recruitment/templates/dashboard/dashboard.html index 5cfcefc50..5ce493bb3 100644 --- a/recruitment/templates/dashboard/dashboard.html +++ b/recruitment/templates/dashboard/dashboard.html @@ -152,7 +152,7 @@ -
+ {% comment %}
{% trans "Open Positions By Department" %} @@ -171,6 +171,33 @@

{% trans "No department-specific vacancies currently." %}

{% endif %} +
+
+
{% endcomment %} + + +
+
+
+ {% trans "Candidate Offer Letter Status" %} + +
+
+ {% if total_candidates %} +
+ + + +
+ {% else %} +
+
+ +
+
+

{% trans "No Candidates available." %}

+ {% endif %} +
@@ -216,7 +243,7 @@
{% if request.user|is_in_task_managers %}
{% endif %}
{% if stage_chart_count %} - + {% else %}
@@ -282,104 +309,80 @@
{% endif %}
- - -
-
-
- {% trans "Candidate Offer Letter Status" %} - + + {% if ongoing_recruitments %} +
+
+
+ {% trans "Current Hiring Pipeline" %}
-
- {% if total_candidates %} -
- - - -
- {% else %} -
-
- +
+
+
+
+
{% trans "Job Positions" %}
+
{% trans "Initial" %}
+
{% trans "Test" %}
+
{% trans "Interview" %}
+
{% trans "Hired" %}
+
{% trans "Cancelled" %}
+
+
+
+ + {% for job_item in job_data %} + +
+
{{ job_item.0 }}
+
{{ job_item.1 }}
+
{{ job_item.2 }}
+
{{ job_item.3 }}
+
{{ job_item.4 }}
+
{{ job_item.5 }}
+
+ + {% endfor %}
-

{% trans "No Candidates available." %}

- {% endif %} -
-
+ {% endif %}
- -
-
+ {% if ongoing_recruitments %} +
- {% trans "Current Hiring Pipeline" %} -
-
-
-
-
-
{% trans "Job Positions" %}
-
{% trans "Initial" %}
-
{% trans "Test" %}
-
{% trans "Interview" %}
-
{% trans "Hired" %}
-
{% trans "Cancelled" %}
+ {% trans "Ongoing Recruitments & Hiring Managers" %} +
+
+
+
+
+
{% trans "Recruitment" %}
+
{% trans "Manager" %}
+
+
+
+ + {% for recruitment_title, managers in recruitment_manager_mapping.items %} + +
+
{{ recruitment_title }}
+
{{ managers|join:", " }}
+
+ + {% endfor %}
-
- - {% for job_item in job_data %} - -
-
{{ job_item.0 }}
-
{{ job_item.1 }}
-
{{ job_item.2 }}
-
{{ job_item.3 }}
-
{{ job_item.4 }}
-
{{ job_item.5 }}
-
- - {% endfor %} -
-
+ {% endif %}
- -
-
- {% trans "Ongoing Recruitments & Hiring Managers" %} -
-
-
-
-
-
{% trans "Recruitment" %}
-
{% trans "Manager" %}
-
-
-
- - {% for recruitment_title, managers in recruitment_manager_mapping.items %} - -
-
{{ recruitment_title }}
-
{{ managers|join:", " }}
-
- - {% endfor %} -
-
-
-
- +
diff --git a/recruitment/templates/pipeline/pipeline.html b/recruitment/templates/pipeline/pipeline.html index ea37747b1..d69e5faa8 100644 --- a/recruitment/templates/pipeline/pipeline.html +++ b/recruitment/templates/pipeline/pipeline.html @@ -308,7 +308,7 @@ data-job-position ="{{cand.job_position_id}}" > -
+
diff --git a/recruitment/templates/pipeline/pipeline_empty.html b/recruitment/templates/pipeline/pipeline_empty.html index 918371fdb..c361ccf60 100644 --- a/recruitment/templates/pipeline/pipeline_empty.html +++ b/recruitment/templates/pipeline/pipeline_empty.html @@ -40,6 +40,14 @@ x-data="{searchShow: false}"
+ + {% if perms.recruitment.add_recruitment %} + + {% endif %} +
{% if perms.recruitment.add_recruitment %} @@ -51,6 +59,29 @@ x-data="{searchShow: false}"
+ +
diff --git a/recruitment/templates/skill_zone/skill_zone_list.html b/recruitment/templates/skill_zone/skill_zone_list.html index c4752aff2..d732396f8 100644 --- a/recruitment/templates/skill_zone/skill_zone_list.html +++ b/recruitment/templates/skill_zone/skill_zone_list.html @@ -99,126 +99,82 @@
{% for sz_candidate in skill_zone.list %} - {% if sz_candidate.is_active %} -
-
-
-
-
- {% if sz_candidate.candidate_id.profile %} - - {% else %} - - {% endif %} -
- {{sz_candidate}} -
-
-
{{sz_candidate.reason}}
-
{{sz_candidate.added_on}}
-
- -
-
-
- - {% if sz_candidate.is_active %} -
- {% csrf_token %} - -
+
+
+
+
+
+ {% if sz_candidate.candidate_id.profile %} + {% else %} -
- {% csrf_token %} - -
+ {% endif %} - -
+
+ {{sz_candidate}} +
+
+
{{sz_candidate.reason}}
+
{{sz_candidate.added_on}}
+
+ +
+
+
+ + {% comment %} {% if sz_candidate.is_active %} + {% csrf_token %} + > - -
+ {% else %} +
+ {% csrf_token %} + +
+ {% endif %} {% endcomment %} + +
+ {% csrf_token %} + +
+
- - {% endif %} - +
+ {% endfor %}
- - {% comment %}
- - {% trans "Page" %} {{ my_leave_allocation_requests.number }} {% trans "of" %} {{ my_leave_allocation_requests.paginator.num_pages }}. - - -
{% endcomment %} -
{% if skill_zone.list %}
diff --git a/recruitment/templates/skill_zone/skill_zone_nav.html b/recruitment/templates/skill_zone/skill_zone_nav.html index 75132a27f..d252d347c 100644 --- a/recruitment/templates/skill_zone/skill_zone_nav.html +++ b/recruitment/templates/skill_zone/skill_zone_nav.html @@ -53,7 +53,7 @@
{% trans "Candidate Filter" %}
-
+
{{f.form.candidate_id__recruitment_id}} @@ -119,6 +119,12 @@ {{f.form.candidate_id__offer_letter_status}}
+
+
+ + {{f.form.is_active}} +
+
diff --git a/recruitment/views/dashboard.py b/recruitment/views/dashboard.py index e5fd80b79..7ecc7c833 100644 --- a/recruitment/views/dashboard.py +++ b/recruitment/views/dashboard.py @@ -97,8 +97,9 @@ def dashboard(request): for rec in recruitment_obj: data = [stage_type_candidate_count(rec, type[0]) for type in Stage.stage_types] for i in data: - i += stage_chart_count - if i > 1: + stage_chart_count += i + + if stage_chart_count >= 1: stage_chart_count = 1 onboarding_count = Candidate.objects.filter(start_onboard=True) @@ -138,7 +139,7 @@ def dashboard(request): if total_hired_candidates != 0: acceptance_ratio = f"{((onboarding_count / total_hired_candidates) * 100):.1f}" - skill_zone = SkillZone.objects.all() + skill_zone = SkillZone.objects.filter(is_active = True) return render( request, "dashboard/dashboard.html", diff --git a/recruitment/views/views.py b/recruitment/views/views.py index 43c42bf5e..fc147fdd3 100644 --- a/recruitment/views/views.py +++ b/recruitment/views/views.py @@ -1287,7 +1287,7 @@ def send_acknowledgement(request): (file.name, file.read(), file.content_type) for file in other_attachments ] email_backend = ConfiguredEmailBackend() - host = email_backend.dynamic_username_with_display_name + host = email_backend.dynamic_username candidate_obj = Candidate.objects.get(id=candidate_id) template_attachment_ids = request.POST.getlist("template_attachments") bodys = list( @@ -1446,7 +1446,7 @@ def skill_zone_view(request): for zone in skill_groups: all_zones.append(zone["grouper"]) - skill_zone_filtered = SkillZoneFilter(request.GET).qs + skill_zone_filtered = SkillZoneFilter(request.GET).qs.filter(is_active=True) all_zone_objects = list(skill_zone_filtered) unused_skill_zones = list(set(all_zone_objects) - set(all_zones)) @@ -1561,10 +1561,18 @@ def skill_zone_archive(request, sz_id): is_active = skill_zone.is_active if is_active == True: skill_zone.is_active = False + skill_zone_candidates = SkillZoneCandidate.objects.filter(skill_zone_id = sz_id) + for i in skill_zone_candidates: + i.is_active = False + i.save() messages.success(request, _("Skill zone archived successfully..")) else: skill_zone.is_active = True + skill_zone_candidates = SkillZoneCandidate.objects.filter(skill_zone_id = sz_id) + for i in skill_zone_candidates: + i.is_active = True + i.save() messages.success(request, _("Skill zone unarchived successfully..")) skill_zone.save() @@ -1588,10 +1596,14 @@ def skill_zone_filter(request): skill_zone_filtered = SkillZoneFilter(request.GET).qs if request.GET.get("is_active") == "false": skill_zone_filtered = SkillZoneFilter(request.GET).qs.filter(is_active=False) - candidates = candidates.filter(is_active=False) + candidates = SkillZoneCandFilter(request.GET).qs.filter(is_active=False) + print('============================') + print(candidates) + print('============================') + else: skill_zone_filtered = SkillZoneFilter(request.GET).qs.filter(is_active=True) - candidates = candidates.filter(is_active=True) + candidates = SkillZoneCandFilter(request.GET).qs.filter(is_active=True) skill_groups = group_by_queryset( candidates, "skill_zone_id",