Merge master
This commit is contained in:
@@ -85,6 +85,16 @@ class BiometricCardView(HorillaCardView):
|
||||
data-target="#genericModal"
|
||||
""",
|
||||
},
|
||||
{
|
||||
"action": "Fetch Logs",
|
||||
"attrs": """
|
||||
hx-get="{get_fetch_url}"
|
||||
class="oh-dropdown__link"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#BiometricDeviceTestModal"
|
||||
hx-target="#BiometricDeviceTestFormTarget"
|
||||
""",
|
||||
},
|
||||
{
|
||||
"action": "archive_status",
|
||||
"attrs": """
|
||||
|
||||
@@ -225,6 +225,13 @@ class BiometricDevices(HorillaModel):
|
||||
url = reverse_lazy("biometric-device-archive", kwargs={"device_id": self.pk})
|
||||
return url
|
||||
|
||||
def get_fetch_url(self):
|
||||
"""
|
||||
This method to get Fetch Logs url
|
||||
"""
|
||||
url = reverse_lazy("biometric-device-fetch-logs", kwargs={"device_id": self.pk})
|
||||
return url
|
||||
|
||||
def get_delete_url(self):
|
||||
"""
|
||||
This method to get delete url
|
||||
|
||||
@@ -414,7 +414,7 @@ def send_mail(request, automation, instance):
|
||||
if request and hasattr(request, "user") and hasattr(request.user, "employee_get"):
|
||||
try:
|
||||
user = request.user.employee_get
|
||||
display_email_name = f"{user.get_full_name()} <{user.email}>"
|
||||
display_email_name = f"{user.get_full_name()} <{user.get_mail()}>" # 983
|
||||
from_email = display_email_name
|
||||
reply_to = [display_email_name]
|
||||
except Exception as e:
|
||||
|
||||
@@ -11,6 +11,7 @@ from horilla_views.cbv_methods import login_required
|
||||
from horilla_views.generic.cbv.views import HorillaListView, HorillaProfileView
|
||||
from onboarding.filters import CandidateTaskFilter
|
||||
from onboarding.models import CandidateTask
|
||||
from recruitment.cbv import skill_zone
|
||||
from recruitment.cbv.candidate_mail_log import CandidateMailLogTabList
|
||||
from recruitment.cbv_decorators import all_manager_can_enter
|
||||
from recruitment.filters import CandidateFilter
|
||||
@@ -162,6 +163,11 @@ CandidateProfileView.add_tab(
|
||||
"view": views.candidate_interview_tab,
|
||||
"accessibility": "recruitment.cbv.accessibility.empl_scheduled_interview_accessibility",
|
||||
},
|
||||
{
|
||||
"title": "Skill Zone",
|
||||
"view": skill_zone.SkillZoneProfileListView.as_view(),
|
||||
"accessibility": "recruitment.cbv.accessibility.if_manager_accessibility",
|
||||
},
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ from django.utils.decorators import method_decorator
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from horilla_views.cbv_methods import login_required
|
||||
from horilla_views.generic.cbv.views import HorillaFormView
|
||||
from horilla_views.generic.cbv.views import HorillaFormView, HorillaListView
|
||||
from recruitment.cbv_decorators import manager_can_enter
|
||||
from recruitment.forms import SkillZoneCandidateForm, SkillZoneCreateForm
|
||||
from recruitment.models import SkillZone, SkillZoneCandidate
|
||||
from recruitment.models import Candidate, SkillZone, SkillZoneCandidate
|
||||
|
||||
|
||||
@method_decorator(login_required, name="dispatch")
|
||||
@@ -62,6 +62,11 @@ class SkillZoneCandidateFormView(HorillaFormView):
|
||||
context = super().get_context_data(**kwargs)
|
||||
id = self.kwargs.get("sz_id")
|
||||
self.form.fields["skill_zone_id"].initial = id
|
||||
if cand_id := self.request.GET.get("candidate"):
|
||||
self.form.fields["candidate_id"].queryset = self.form.fields[
|
||||
"candidate_id"
|
||||
].queryset.filter(id=cand_id)
|
||||
|
||||
# if self.form.instance.pk:
|
||||
# self.form_class.verbose_name = _("Update Skill Zone")
|
||||
return context
|
||||
@@ -76,3 +81,36 @@ class SkillZoneCandidateFormView(HorillaFormView):
|
||||
messages.success(self.request, _(message))
|
||||
return self.HttpResponse("<script>window.location.reload()</script>")
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
@method_decorator(login_required, name="dispatch")
|
||||
@method_decorator(
|
||||
manager_can_enter("recruitment.add_skillzonecandidate"), name="dispatch"
|
||||
)
|
||||
class SkillZoneProfileListView(HorillaListView):
|
||||
"""
|
||||
Skill Zone Candidate profile List View
|
||||
"""
|
||||
|
||||
model = SkillZoneCandidate
|
||||
show_filter_tags = False
|
||||
filter_selected = False
|
||||
bulk_select_option = False
|
||||
template_name = "skill_zone/candidate_profile_tab.html"
|
||||
show_toggle_form = False
|
||||
|
||||
columns = [
|
||||
(_("Title"), "skill_zone_id__title"),
|
||||
"added_on",
|
||||
"reason",
|
||||
]
|
||||
|
||||
def get_queryset(self):
|
||||
qureryset = super().get_queryset()
|
||||
cand_id = self.kwargs.get("pk")
|
||||
return qureryset.filter(candidate_id=cand_id)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["candidate"] = Candidate.objects.get(id=self.kwargs.get("pk"))
|
||||
return context
|
||||
|
||||
12
recruitment/templates/skill_zone/candidate_profile_tab.html
Normal file
12
recruitment/templates/skill_zone/candidate_profile_tab.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div class="d-flex justify-content-between mb-3 me-3 align-items-center">
|
||||
<span class="oh-activity-sidebar__title fw-bold font-semibold">{{candidate}}{% trans "'s Scheduled Interviews" %}</span>
|
||||
|
||||
<button type="button" hx-get="{% url 'skill-zone-cand-create' candidate.id %}?candidate={{candidate.id}}" title="Schedule Interview" hx-target="#genericModalBody" hx-swap="innerHTML" data-target="#genericModal" class="oh-btn oh-btn--secondary mt-2 mr-0 oh-btn--w-100-resp" data-toggle="oh-modal-toggle">
|
||||
<ion-icon name="add" class="mr-1 md hydrated" role="img" aria-label="add"></ion-icon>
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% include "generic/horilla_list_table.html" %}
|
||||
Reference in New Issue
Block a user