401 lines
19 KiB
HTML
401 lines
19 KiB
HTML
{% extends "base.html" %}
|
|
{% load static i18n %}
|
|
|
|
{% block title %}Job Postings - University ATS{% endblock %}
|
|
|
|
{% block customCSS %}
|
|
<style>
|
|
/* UI Variables for the KAAT-S Theme */
|
|
:root {
|
|
--kaauh-teal: #00636e;
|
|
--kaauh-teal-dark: #004a53;
|
|
--kaauh-border: #eaeff3;
|
|
--kaauh-primary-text: #343a40;
|
|
--kaauh-success: #28a745;
|
|
--kaauh-danger: #dc3545;
|
|
}
|
|
|
|
/* Primary Color Overrides */
|
|
.text-primary-theme { color: var(--kaauh-teal) !important; }
|
|
.bg-primary-theme { background-color: var(--kaauh-teal) !important; }
|
|
.text-success { color: var(--kaauh-success) !important; }
|
|
.text-danger { color: var(--kaauh-danger) !important; }
|
|
.text-info { color: #17a2b8 !important; }
|
|
|
|
/* Enhanced Card Styling */
|
|
.card {
|
|
border: 1px solid var(--kaauh-border);
|
|
border-radius: 0.75rem;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
}
|
|
.card:not(.no-hover):hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 16px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
/* Main Action Button Style (Teal Theme) */
|
|
.btn-main-action {
|
|
background-color: var(--kaauh-teal);
|
|
border-color: var(--kaauh-teal);
|
|
color: white;
|
|
font-weight: 600;
|
|
transition: all 0.2s ease;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.btn-main-action:hover {
|
|
background-color: var(--kaauh-teal-dark);
|
|
border-color: var(--kaauh-teal-dark);
|
|
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
/* Secondary Button Style (using theme border) */
|
|
.btn-outline-secondary {
|
|
color: var(--kaauh-teal-dark);
|
|
border-color: var(--kaauh-teal);
|
|
}
|
|
.btn-outline-secondary:hover {
|
|
background-color: var(--kaauh-teal-dark);
|
|
color: white;
|
|
border-color: var(--kaauh-teal-dark);
|
|
}
|
|
|
|
/* Status Badges */
|
|
.status-badge {
|
|
font-size: 0.8rem;
|
|
padding: 0.4em 0.8em;
|
|
border-radius: 0.4rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.7px;
|
|
color: white;
|
|
}
|
|
.bg-DRAFT { background-color: #6c757d !important; }
|
|
.bg-ACTIVE { background-color: var(--kaauh-teal) !important; }
|
|
.bg-CLOSED { background-color: #dc3545 !important; }
|
|
.bg-ARCHIVED { background-color: #343a40 !important; }
|
|
.bg-info { background-color: #17a2b8 !important; }
|
|
|
|
/* --- TABLE ALIGNMENT AND SIZING FIXES --- */
|
|
.table {
|
|
table-layout: fixed; /* Ensures width calculations are respected */
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
.table thead th {
|
|
color: var(--kaauh-primary-text);
|
|
font-weight: 600;
|
|
font-size: 0.85rem;
|
|
vertical-align: middle;
|
|
border-bottom: 2px solid var(--kaauh-border);
|
|
padding: 0.5rem 0.25rem;
|
|
}
|
|
.table-hover tbody tr:hover {
|
|
background-color: #f3f7f9;
|
|
}
|
|
|
|
/*
|
|
* OPTIMIZED MAIN TABLE COLUMN WIDTHS (Total must be 100%)
|
|
* --------------------------------------------------------
|
|
* 1. Job Title/ID: 25% (Needs the most space)
|
|
* 2. Source: 10%
|
|
* 3. Max Apps: 7%
|
|
* 4. Deadline: 10%
|
|
* 5. Actions: 8%
|
|
* 6. Manage Forms: 10%
|
|
* 7. Applicants Metrics: 30% (Colspan 5)
|
|
* TOTAL: 25 + 10 + 7 + 10 + 8 + 10 + 30 = 100%
|
|
*/
|
|
.table th:nth-child(1) { width: 20%; } /* Job Title */
|
|
.table th:nth-child(2) { width: 10%; } /* Source */
|
|
.table th:nth-child(3) { width: 7%; } /* Max Apps */
|
|
.table th:nth-child(4) { width: 10%; } /* Deadline */
|
|
.table th:nth-child(5) { width: 8%; } /* Actions */
|
|
.table th:nth-child(6) { width: 10%; } /* Manage Forms */
|
|
/* The 7th column (Metrics) is 30% and is handled by its colspan */
|
|
|
|
|
|
/* Candidate Management Header Row (The one with the stage names) */
|
|
.nested-metrics-row th {
|
|
font-weight: 500;
|
|
color: #6c757d;
|
|
font-size: 0.75rem;
|
|
padding: 0.3rem 0;
|
|
border-bottom: 2px solid var(--kaauh-teal);
|
|
text-align: center;
|
|
border-left: 1px solid var(--kaauh-border);
|
|
}
|
|
|
|
/* Metrics Sub-Column Widths (7 total sub-columns, total 30%) */
|
|
/* We have 5 main metrics: Applied, Screened, Exam, Interview, Offer.
|
|
* Let's allocate the 30% evenly: 30% / 5 = 6% per metric column.
|
|
*/
|
|
.nested-metrics-row th {
|
|
width: 6%; /* 30% / 5 metrics = 6% per metric column */
|
|
}
|
|
|
|
/* Main TH for Candidate Management Header Title */
|
|
.candidate-management-header-title {
|
|
text-align: center;
|
|
padding: 0.5rem 0.25rem;
|
|
border-left: 2px solid var(--kaauh-teal);
|
|
border-right: 1px solid var(--kaauh-border) !important;
|
|
font-weight: 600;
|
|
color: var(--kaauh-teal-dark);
|
|
}
|
|
|
|
/* Candidate Management Data Cells (5 columns total for metrics) */
|
|
.candidate-data-cell {
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
font-weight: 600;
|
|
font-size: 0.9rem;
|
|
padding: 0;
|
|
}
|
|
.table tbody td.candidate-data-cell:not(:first-child) {
|
|
border-left: 1px solid var(--kaauh-border);
|
|
}
|
|
/* Adds a distinctive vertical line before the metrics group (7th column) */
|
|
.table tbody tr td:nth-child(7) {
|
|
border-left: 2px solid var(--kaauh-teal);
|
|
}
|
|
|
|
.candidate-data-cell a {
|
|
display: block;
|
|
text-decoration: none;
|
|
padding: 0.4rem 0.25rem;
|
|
}
|
|
|
|
/* Fix action button sizing */
|
|
.btn-group-sm > .btn {
|
|
padding: 0.2rem 0.4rem;
|
|
font-size: 0.75rem;
|
|
}
|
|
|
|
/* Additional CSS for Card View layout (rest of your styles...) */
|
|
.card-view .card {
|
|
height: 100%;
|
|
}
|
|
.card-view .card-title {
|
|
color: var(--kaauh-teal-dark);
|
|
font-weight: 700;
|
|
font-size: 1.25rem;
|
|
}
|
|
.card-view .card-body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
flex-grow: 1;
|
|
}
|
|
.card-view .list-unstyled li {
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid py-4">
|
|
{# ... (Rest of the header and filter content) ... #}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1 style="color: var(--kaauh-teal-dark); font-weight: 700;">
|
|
<i class="fas fa-briefcase me-2"></i> {% trans "Job Postings" %}
|
|
</h1>
|
|
<a href="{% url 'job_create' %}" class="btn btn-main-action">
|
|
<i class="fas fa-plus me-1"></i> {% trans "Create New Job" %}
|
|
</a>
|
|
</div>
|
|
|
|
{# ... (Filter card) ... #}
|
|
<div class="card mb-4 shadow-sm no-hover">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<label for="search" class="form-label small text-muted">{% trans "Search by Title or Department" %}</label>
|
|
<div class="input-group input-group-lg mb-3">
|
|
<form method="get" action="" class="w-100">
|
|
{% include 'includes/search_form.html' %}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<form method="GET" class="row g-3 align-items-end" >
|
|
<div class="col-md-4">
|
|
<label for="status" class="form-label small text-muted">{% trans "Filter by Status" %}</label>
|
|
<select name="status" id="status" class="form-select form-select-sm">
|
|
<option value="">{% trans "All Statuses" %}</option>
|
|
<option value="DRAFT" {% if status_filter == 'DRAFT' %}selected{% endif %}>{% trans "Draft" %}</option>
|
|
<option value="ACTIVE" {% if status_filter == 'ACTIVE' %}selected{% endif %}>{% trans "Active" %}</option>
|
|
<option value="CLOSED" {% if status_filter == 'CLOSED' %}selected{% endif %}>{% trans "Closed" %}</option>
|
|
<option value="ARCHIVED" {% if status_filter == 'ARCHIVED' %}selected{% endif %}>{% trans "Archived" %}</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="filter-buttons">
|
|
<button type="submit" class="btn btn-main-action btn-sm">
|
|
<i class="fas fa-filter me-1"></i> {% trans "Apply Filters" %}
|
|
</button>
|
|
{% if job_filter or search_query %}
|
|
<a href="{% url 'job_list' %}" class="btn btn-outline-secondary">
|
|
<i class="fas fa-times me-1"></i> {% trans "Clear" %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{# --- START OF JOB LIST CONTAINER --- #}
|
|
<div id="job-list">
|
|
{% include "includes/_list_view_switcher.html" with list_id="job-list" %}
|
|
|
|
{# 1. TABLE VIEW (Default Active) #}
|
|
<div class="table-view active d-md-none">
|
|
<div class="card shadow-sm">
|
|
<div class="table-responsive ">
|
|
<table class="table table-hover align-middle mb-0 table-sm">
|
|
|
|
{# --- Corrected Multi-Row Header Structure --- #}
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" rowspan="2">{% trans "Job Title / ID" %}</th>
|
|
<th scope="col" rowspan="2">{% trans "Source" %}</th>
|
|
<th scope="col" rowspan="2">{% trans "Max Apps" %}</th>
|
|
<th scope="col" rowspan="2">{% trans "Deadline" %}</th>
|
|
<th scope="col" rowspan="2">{% trans "Actions" %}</th>
|
|
<th scope="col" rowspan="2" class="text-center">{% trans "Manage Forms" %}</th>
|
|
|
|
<th scope="col" colspan="5" class="candidate-management-header-title">
|
|
{% trans "Applicants Metrics" %}
|
|
</th>
|
|
</tr>
|
|
|
|
<tr class="nested-metrics-row">
|
|
<th style="width: calc(50% / 7);">{% trans "All" %}</th>
|
|
<th style="width: calc(50% / 7);">{% trans "Screened" %}</th>
|
|
<th style="width: calc(50% / 7 * 2);">{% trans "Exam" %}</th>
|
|
<th style="width: calc(50% / 7 * 2);">{% trans "Interview" %}</th>
|
|
<th style="width: calc(50% / 7);">{% trans "Offer" %}</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{% for job in jobs %}
|
|
<tr>
|
|
<td class="fw-medium text-primary-theme">
|
|
<a href="{% url 'job_detail' job.slug %}" class="text-decoration-none">{{ job.title }}</a>
|
|
<br>
|
|
<small class="text-muted">{{ job.pk }} / </small>
|
|
<span class="badge bg-{{ job.status }} status-badge">{{ job.status }}</span>
|
|
</td>
|
|
<td>{{ job.get_source }}</td>
|
|
<td>{{ job.max_applications }}</td>
|
|
<td>{{ job.application_deadline|date:"d-m-Y" }}</td>
|
|
<td>
|
|
<div class="btn-group btn-group-sm" role="group">
|
|
<a href="{% url 'job_detail' job.slug %}" class="btn btn-outline-secondary" title="{% trans 'View' %}">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
<a href="{% url 'job_update' job.slug %}" class="btn btn-outline-secondary" title="{% trans 'Edit' %}">
|
|
<i class="fas fa-edit"></i>
|
|
</a>
|
|
</div>
|
|
</td>
|
|
<td class="text-center">
|
|
<div class="btn-group btn-group-sm" role="group">
|
|
{% if job.form_template %}
|
|
<a href="{% url 'application_submit_form' job.form_template.slug %}" class="btn btn-outline-secondary" title="{% trans 'Preview' %}">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
<a href="{% url 'form_builder' job.form_template.slug %}" class="btn btn-outline-secondary" title="{% trans 'Edit' %}">
|
|
<i class="fas fa-edit"></i>
|
|
</a>
|
|
<a href="{% url 'form_template_submissions_list' job.form_template.slug %}" class="btn btn-outline-secondary" title="{% trans 'Submissions' %}">
|
|
<i class="fas fa-file-alt"></i>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
|
|
{# CANDIDATE MANAGEMENT DATA - URLS NEUTRALIZED #}
|
|
<td class="candidate-data-cell text-primary-theme"><a href="{% url 'candidate_screening_view' job.slug %}" class="text-primary-theme">{% if job.all_candidates.count %}{{ job.all_candidates.count }}{% else %}-{% endif %}</a></td>
|
|
<td class="candidate-data-cell text-info"><a href="{% url 'candidate_screening_view' job.slug %}" class="text-info">{% if job.screening_candidates.count %}{{ job.screening_candidates.count }}{% else %}-{% endif %}</a></td>
|
|
<td class="candidate-data-cell text-success"><a href="{% url 'candidate_exam_view' job.slug %}" class="text-success">{% if job.exam_candidates.count %}{{ job.exam_candidates.count }}{% else %}-{% endif %}</a></td>
|
|
<td class="candidate-data-cell text-success"><a href="{% url 'candidate_interview_view' job.slug %}" class="text-success">{% if job.interview_candidates.count %}{{ job.interview_candidates.count }}{% else %}-{% endif %}</a></td>
|
|
<td class="candidate-data-cell text-success"><a href="{% url 'candidate_offer_view' job.slug %}" class="text-success">{% if job.offer_candidates.count %}{{ job.offer_candidates.count }}{% else %}-{% endif %}</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{# ... (Card View and Paginator content) ... #}
|
|
<div class="card-view row g-4">
|
|
{% for job in jobs %}
|
|
<div class="col-xl-4 col-lg-6 col-md-6">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
|
<h5 class="card-title mb-0"><a href="{% url 'job_detail' job.slug %}" class="text-decoration-none text-primary-theme">{{ job.title }}</a></h5>
|
|
<span class="badge bg-{{ job.status }} status-badge">{{ job.status }}</span>
|
|
</div>
|
|
<p class="text-muted small mb-3">ID: {{ job.pk }} | Source: {{ job.get_source }}</p>
|
|
|
|
<ul class="list-unstyled small mb-3">
|
|
<li><i class="fas fa-users text-primary-theme me-2"></i>{% trans "Applicants" %}:{{ job.metrics.applied|default:"0" }}</li>
|
|
<li><i class="fas fa-clipboard-check text-success me-2"></i> {% trans "Offers Made" %}: {{ job.metrics.offer|default:"0" }}</li>
|
|
<li><i class="fas fa-file-alt text-info me-2"></i> {% trans "Form" %}:{% if job.form_template %}
|
|
<a href="{% url 'application_submit_form' job.form_template.pk %}" class="text-info">{{ job.form_template.name }}</a>
|
|
{% else %}
|
|
{% trans "N/A" %}
|
|
{% endif %}
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="d-flex justify-content-between mt-auto pt-3 border-top">
|
|
<a href="{% url 'job_detail' job.slug %}" class="btn btn-outline-secondary btn-sm" title="{% trans 'View' %}">
|
|
<i class="fas fa-eye me-1"></i> {% trans "Details" %}
|
|
</a>
|
|
<div class="btn-group btn-group-sm">
|
|
<a href="{% url 'job_update' job.slug %}" class="btn btn-outline-secondary" title="{% trans 'Edit Job' %}">
|
|
<i class="fas fa-edit"></i>
|
|
</a>
|
|
{% if job.form_template %}
|
|
<a href="{% url 'form_template_submissions_list' job.form_template.slug %}" class="btn btn-outline-secondary" title="{% trans 'Submissions' %}">
|
|
<i class="fas fa-file-alt"></i>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{# --- END CARD VIEW --- #}
|
|
</div>
|
|
{# --- END OF JOB LIST CONTAINER --- #}
|
|
{% include "includes/paginator.html" %}
|
|
{% if not jobs and not job_list_data and not page_obj %}
|
|
<div class="text-center py-5 card shadow-sm mt-4">
|
|
<div class="card-body">
|
|
<i class="fas fa-briefcase fa-3x mb-3" style="color: var(--kaauh-teal-dark);"></i>
|
|
<h3>{% trans "No job postings found" %}</h3>
|
|
<p class="text-muted">{% trans "Create your first job posting to get started or adjust your filters." %}</p>
|
|
<a href="{% url 'job_create' %}" class="btn btn-main-action mt-3">
|
|
<i class="fas fa-plus me-1"></i> {% trans "Create Job" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %} |