kaauh_ats/templates/people/create_person.html

308 lines
12 KiB
HTML

{% extends "base.html" %}
{% load static i18n crispy_forms_tags %}
{% block title %}{% trans "Create Applicant" %} - {{ block.super }}{% endblock %}
{% block customCSS %}
<style>
/* UI Variables for the KAAT-S Theme */
:root {
--kaauh-teal: #00636e;
--kaauh-teal-dark: #004a53;
--kaauh-border: #eaeff3;
--kaauh-gray-light: #f8f9fa;
}
/* Form Container Styling */
.form-container {
max-width: 800px;
margin: 0 auto;
}
/* Card Styling */
.card {
border: 1px solid var(--kaauh-border);
border-radius: 0.75rem;
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
/* Main Action Button Style */
.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.4rem;
padding: 0.5rem 1.5rem;
}
.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 */
.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);
}
/* Form Field Styling */
.form-control:focus {
border-color: var(--kaauh-teal);
box-shadow: 0 0 0 0.2rem rgba(0, 99, 110, 0.25);
}
.form-select:focus {
border-color: var(--kaauh-teal);
box-shadow: 0 0 0 0.2rem rgba(0, 99, 110, 0.25);
}
/* Profile Image Upload Styling */
.profile-image-upload {
border: 2px dashed var(--kaauh-border);
border-radius: 0.5rem;
padding: 2rem;
text-align: center;
transition: all 0.3s ease;
cursor: pointer;
}
.profile-image-upload:hover {
border-color: var(--kaauh-teal);
background-color: var(--kaauh-gray-light);
}
.profile-image-preview {
width: 120px;
height: 120px;
object-fit: cover;
border-radius: 50%;
border: 3px solid var(--kaauh-teal);
margin: 0 auto 1rem;
}
/* Breadcrumb Styling */
.breadcrumb {
background-color: transparent;
padding: 0;
margin-bottom: 1rem;
}
.breadcrumb-item + .breadcrumb-item::before {
content: ">";
color: var(--kaauh-teal);
}
/* Alert Styling */
.alert {
border-radius: 0.5rem;
border: none;
}
/* Loading State */
.btn.loading {
position: relative;
pointer-events: none;
opacity: 0.8;
}
.btn.loading::after {
content: "";
position: absolute;
width: 16px;
height: 16px;
margin: auto;
border: 2px solid transparent;
border-top-color: #ffffff;
border-radius: 50%;
animation: spin 1s linear infinite;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
{% endblock %}
{% block content %}
<div class="container-fluid py-4">
<div class="form-container">
<!-- Breadcrumb Navigation -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{% url 'person_list' %}" class="text-secondary text-decoration-none">
<i class="fas fa-user-friends me-1"></i> {% trans "Applicants" %}
</a>
</li>
<li class="breadcrumb-item active" aria-current="page"
style="
color: #F43B5E; /* Rosy Accent Color */
font-weight: 600;
">{% trans "Create Applicant" %}</li>
</ol>
</nav>
<!-- Header -->
<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-user-plus me-2"></i> {% trans "Create New Applicant" %}
</h1>
<a href="{% url 'person_list' %}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left me-1"></i> {% trans "Back to List" %}
</a>
</div>
<!-- Form Card -->
<div class="card shadow-sm">
<div class="card-body p-4">
{% if form.non_field_errors %}
<div class="alert alert-danger" role="alert">
<h5 class="alert-heading">
<i class="fas fa-exclamation-triangle me-2"></i>{% trans "Error" %}
</h5>
{% for error in form.non_field_errors %}
<p class="mb-0">{{ error }}</p>
{% endfor %}
</div>
{% endif %}
<form method="post" enctype="multipart/form-data" id="person-form">
{% csrf_token %}
{{form|crispy}}
<!-- Profile Image Section -->
{% comment %} <div class="row mb-4">
<div class="col-12">
<div class="profile-image-upload" onclick="document.getElementById('id_profile_image').click()">
<div id="image-preview-container">
<i class="fas fa-camera fa-3x text-muted mb-3"></i>
<h5 class="text-muted">{% trans "Upload Profile Photo" %}</h5>
<p class="text-muted small">{% trans "Click to browse or drag and drop" %}</p>
</div>
<input type="file" name="profile_image" id="id_profile_image"
class="d-none" accept="image/*">
</div>
</div>
</div>
<!-- Personal Information Section -->
<div class="row mb-4">
<div class="col-12">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); border-bottom: 2px solid var(--kaauh-teal); padding-bottom: 0.5rem;">
<i class="fas fa-user me-2"></i> {% trans "Personal Information" %}
</h5>
</div>
<div class="col-md-4">
{{ form.first_name|as_crispy_field }}
</div>
<div class="col-md-4">
{{ form.middle_name|as_crispy_field }}
</div>
<div class="col-md-4">
{{ form.last_name|as_crispy_field }}
</div>
</div>
<!-- Contact Information Section -->
<div class="row mb-4">
<div class="col-12">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); border-bottom: 2px solid var(--kaauh-teal); padding-bottom: 0.5rem;">
<i class="fas fa-envelope me-2"></i> {% trans "Contact Information" %}
</h5>
</div>
<div class="col-md-6">
{{ form.email|as_crispy_field }}
</div>
<div class="col-md-6">
{{ form.phone|as_crispy_field }}
</div>
</div>
<!-- Additional Information Section -->
<div class="row mb-4">
<div class="col-12">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); border-bottom: 2px solid var(--kaauh-teal); padding-bottom: 0.5rem;">
<i class="fas fa-info-circle me-2"></i> {% trans "Additional Information" %}
</h5>
</div>
<div class="col-md-4">
{{ form.date_of_birth|as_crispy_field }}
</div>
<div class="col-md-4">
{{ form.nationality|as_crispy_field }}
</div>
<div class="col-md-4">
{{ form.gender|as_crispy_field }}
</div>
</div>
<!-- Address Section -->
<div class="row mb-4">
<div class="col-12">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); border-bottom: 2px solid var(--kaauh-teal); padding-bottom: 0.5rem;">
<i class="fas fa-map-marker-alt me-2"></i> {% trans "Address" %}
</h5>
</div>
<div class="col-12">
{{ form.address }}
</div>
</div> {% endcomment %}
<!-- LinkedIn Profile Section -->
{% comment %} <div class="row mb-4">
<div class="col-12">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); border-bottom: 2px solid var(--kaauh-teal); padding-bottom: 0.5rem;">
<i class="fab fa-linkedin me-2"></i> {% trans "Professional Profile" %}
</h5>
</div>
<div class="col-12">
<div class="form-group mb-3">
<label for="id_linkedin_profile" class="form-label">
{% trans "LinkedIn Profile URL" %}
</label>
<input type="url" name="linkedin_profile" id="id_linkedin_profile"
class="form-control" placeholder="https://linkedin.com/in/username">
<small class="form-text text-muted">
{% trans "Optional: Add LinkedIn profile URL" %}
</small>
</div>
</div>
</div> {% endcomment %}
<!-- Form Actions -->
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center">
<a href="{% url 'person_list' %}" class="btn btn-outline-secondary">
<i class="fas fa-times me-1"></i> {% trans "Cancel" %}
</a>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-main-action">
<i class="fas fa-save me-1"></i> {% trans "Create Applicant" %}
</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}