kaauh_ats/templates/jobs/job_list.html
2025-10-13 17:07:21 +03:00

331 lines
16 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;
}
/* Primary Color Overrides */
.text-primary-theme { color: var(--kaauh-teal) !important; }
.bg-primary-theme { background-color: var(--kaauh-teal) !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;
}
.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 column widths are respected */
width: 100%;
}
.table thead th {
color: var(--kaauh-primary-text);
font-weight: 500; /* Lighter weight for smaller font */
font-size: 0.85rem; /* Smaller font size for header text */
vertical-align: middle;
border-bottom: 2px solid var(--kaauh-border);
padding: 0.5rem 0.25rem; /* Reduced vertical and horizontal padding */
}
.table-hover tbody tr:hover {
background-color: #f3f7f9;
}
/* Optimized Main Table Column Widths (Total must be 100%) */
.table th:nth-child(1) { width: 22%; } /* Job ID (Tight) */
.table th:nth-child(2) { width: 12%; } /* Source (Tight) */
.table th:nth-child(3) { width: 8%; } /* Actions (Tight, icon buttons) */
.table th:nth-child(4) { width: 8%; } /* Form (Tight, icon buttons) */
.table th:nth-child(5) { width: 50%; } /* Candidate Metrics (colspan=7) */
/* NESTED TABLE STYLING FOR CANDIDATE MANAGEMENT HEADER */
.nested-header-table {
margin: 0;
padding: 0;
width: 100%;
border-collapse: collapse;
table-layout: fixed; /* CRITICAL for 1:1 data alignment */
}
.nested-header-table thead th {
background-color: transparent;
border: none;
padding: 0.3rem 0 0.1rem 0; /* Reduced padding here too */
font-weight: 500;
text-align: center;
color: #6c757d;
font-size: 0.75rem; /* Even smaller font for nested headers */
width: calc(100% / 7);
}
/* Explicit widths are technically defined by the 1/7 rule, but keeping them for clarity/safety */
.nested-header-table thead th:nth-child(1),
.nested-header-table thead th:nth-child(2),
.nested-header-table thead th:nth-child(5) {
width: calc(100% / 7);
}
.nested-header-table thead th:nth-child(3),
.nested-header-table thead th:nth-child(4) {
width: calc(100% / 7 * 2);
}
/* Inner Nested Table (P/F) */
.nested-stage-metrics {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
.nested-stage-metrics thead th {
padding: 0.1rem 0; /* Very minimal padding */
font-weight: 600;
color: var(--kaauh-teal-dark);
font-size: 0.7rem; /* Smallest font size */
width: 50%;
}
/* Main TH for Candidate Management Header */
.candidate-management-header {
text-align: center;
padding: 0;
border-left: 2px solid var(--kaauh-teal);
border-right: 1px solid var(--kaauh-border) !important;
}
/* Candidate Management Data Cells (7 columns total now) */
.candidate-data-cell {
text-align: center;
vertical-align: middle;
font-weight: 600;
font-size: 0.9rem; /* Keep data readable */
border-left: 1px solid var(--kaauh-border);
}
.candidate-data-cell a {
display: block;
text-decoration: none;
padding: 0.4rem 0; /* Minimized vertical padding */
}
</style>
{% endblock %}
{% block content %}
<div class="container-fluid py-4">
<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>
<div class="card mb-4 shadow-sm no-hover">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<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-8">
<form method="GET" class="row g-3 align-items-end" >
<div class="col-md-3">
<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-5">
<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>
<a href="{% url 'job_list' %}" class="btn btn-outline-secondary btn-sm">
<i class="fas fa-times me-1"></i> {% trans "Clear" %}
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% comment %} --- START OF TABLE VIEW (Data relied upon context variable 'jobs') --- {% endcomment %}
<div id="job-list">
{% comment %} Placeholder for View Switcher {% endcomment %}
{% include "includes/_list_view_switcher.html" with list_id="job-list" %}
<div class="table-view active">
<div class="card shadow-sm">
<div class="table-responsive ">
<table class="table table-hover align-middle mb-0 table-sm">
<thead>
<tr>
<th scope="col">{% trans "Job ID" %}</th>
{% comment %} <th scope="col">{% trans "Job Title" %}</th>
<th scope="col">{% trans "Status" %}</th> {% endcomment %}
<th scope="col">{% trans "Source" %}</th>
<th scope="col">{% trans "Actions" %}</th>
<th scop="col" class="text-center">{% trans "Manage Forms" %}</th>
<th scope="col" colspan="7" class="candidate-management-header">
{% trans "Applicants Metrics" %}
<table class="nested-header-table">
<thead>
<tr>
<th style="width: 14.28%;">{% trans "Applied" %}</th>
<th style="width: 14.28%;">{% trans "Screened" %}</th>
<th colspan="2">{% trans "Exam" %}
<table class="nested-stage-metrics">
<thead>
<th>P</th>
<th>F</th>
</thead>
</table>
</th>
<th colspan="2">{% trans "Interview" %}
<table class="nested-stage-metrics">
<thead>
<th>P</th>
<th>F</th>
</thead>
</table>
</th>
<th style="width: 14.28%;">{% trans "Offer" %}</th>
</tr>
</thead>
</table>
</th>
</tr>
</thead>
<tbody>
{% comment %} This loop relies on the 'jobs' variable passed from the Django view {% endcomment %}
{% for job in jobs %}
<tr>
<td class="fw-medium text-primary-theme">{{ job }}</td>
{% comment %} <td class="fw-medium text-primary-theme">{{ job.title }}</td>
<td><span class="badge bg-{{ job.status }} status-badge">{{ job.status }}</span></td> {% endcomment %}
<td>{{ job.get_source }}</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-end">
<div class="btn-group btn-group-sm" role="group">
<a href="{% url 'form_wizard' job.form_template.id %}" class="btn btn-outline-primary" title="{% trans 'Preview' %}">
<i class="fas fa-eye"></i>
</a>
<a href="{% url 'form_builder' job.form_template.id %}" 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>
</div>
</td>
{# CANDIDATE MANAGEMENT DATA - 7 SEPARATE COLUMNS CORRESPONDING TO THE HEADER #}
<td class="candidate-data-cell text-primary-theme"><a href="#" class="text-primary-theme">{% if job.metrics.applied %}{{ job.metrics.applied }}{% else %}-{% endif %}</a></td>
<td class="candidate-data-cell text-info"><a href="#" class="text-info">{% if job.metrics.screening %}{{ job.metrics.screening }}{% else %}-{% endif %}</a></td>
<td class="candidate-data-cell text-success"><a href="#" class="text-success">{% if job.metrics.exam_p %}{{ job.metrics.exam_p }}{% else %}-{% endif %}</a></td>
<td class="candidate-data-cell text-danger"><a href="#" class="text-danger">{% if job.metrics.exam_f %}{{ job.metrics.exam_f }}{% else %}-{% endif %}</a></td>
<td class="candidate-data-cell text-success"><a href="#" class="text-success">{% if job.metrics.interview_p %}{{ job.metrics.interview_p }}{% else %}-{% endif %}</a></td>
<td class="candidate-data-cell text-danger"><a href="#" class="text-danger">{% if job.metrics.interview_f %}{{ job.metrics.interview_f }}{% else %}-{% endif %}</a></td>
<td class="candidate-data-cell text-success"><a href="#" class="text-success">{% if job.metrics.offer %}{{ job.metrics.offer }}{% else %}-{% endif %}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% comment %} Fallback/Empty State {% endcomment %}
{% if not jobs and not job_list_data and not page_obj %}
<div class="text-center py-5 card shadow-sm">
<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 %}