update department on save to tile case for saerch filters

This commit is contained in:
Faheed 2025-11-23 16:44:16 +03:00
parent 99f62c21fa
commit 479fde7f38
4 changed files with 7385 additions and 1100 deletions

File diff suppressed because it is too large Load Diff

View File

@ -287,7 +287,10 @@ class JobPosting(Base):
next_num = 1 next_num = 1
self.internal_job_id = f"{prefix}-{year}-{next_num:06d}" self.internal_job_id = f"{prefix}-{year}-{next_num:06d}"
if self.department:
self.department = self.department.title()
super().save(*args, **kwargs) super().save(*args, **kwargs)
def get_location_display(self): def get_location_display(self):

View File

@ -806,11 +806,11 @@ def kaauh_career(request):
selected_job_type = request.GET.get("employment_type", "") selected_job_type = request.GET.get("employment_type", "")
job_type_keys = active_jobs.order_by("job_type").distinct("job_type").values_list("job_type", flat=True) job_type_keys = active_jobs.order_by("job_type").distinct("job_type").values_list("job_type", flat=True)
print(job_type_keys)
workplace_type_keys = active_jobs.order_by("workplace_type").distinct("workplace_type").values_list( workplace_type_keys = active_jobs.order_by("workplace_type").distinct("workplace_type").values_list(
"workplace_type", flat=True "workplace_type", flat=True
).distinct() ).distinct()
print(workplace_type_keys)
if selected_job_type and selected_job_type in job_type_keys: if selected_job_type and selected_job_type in job_type_keys:
active_jobs = active_jobs.filter(job_type=selected_job_type) active_jobs = active_jobs.filter(job_type=selected_job_type)
if selected_workplace_type and selected_workplace_type in workplace_type_keys: if selected_workplace_type and selected_workplace_type in workplace_type_keys:

View File

@ -285,9 +285,7 @@
<li class="nav-item me-lg-4"> <li class="nav-item me-lg-4">
<a class="nav-link {% if request.resolver_match.url_name == 'kaauh_career' %}active{% endif %}" href="{% url 'kaauh_career' %}"> <a class="nav-link {% if request.resolver_match.url_name == 'kaauh_career' %}active{% endif %}" href="{% url 'kaauh_career' %}">
<span class="d-flex align-items-center gap-2"> <span class="d-flex align-items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"> <i class="fas fa-globe me-2"></i>
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z" />
</svg>
{% trans "Career Page" %} {% trans "Career Page" %}
</span> </span>