kaauh_ats/templates/applicant/partials/candidate_facing_base.html
2025-12-24 19:03:23 +03:00

290 lines
10 KiB
HTML

{% load static i18n %}
{% get_current_language as LANGUAGE_CODE %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" dir="{% if LANGUAGE_CODE == 'ar' %}rtl{% else %}ltr{% endif %}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% trans "Careers" %} - {% block title %}{% trans "Application Form" %}{% endblock %}</title>
<link rel="icon" type="image/png" href="{% static 'image/favicon/favicon-32x32.png'%}">
<style>
:root {
--kaauh-teal: #00636e;
--kaauh-teal-dark: #004a53;
--kaauh-teal-light: #e6f7f8;
--white: #ffffff;
--light-bg: #f8f9fa;
--gray-text: #6c757d;
--danger: #dc3545;
--border: #d0d7de;
--shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
--nav-height: 70px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background-color: var(--light-bg);
color: #333;
line-height: 1.5;
}
/* --- NAVIGATION --- */
.navbar {
height: var(--nav-height);
background: var(--white);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
padding-inline: 2rem;
position: sticky;
top: 0;
z-index: 1000;
justify-content: space-between;
}
.nav-brand {
display: flex;
align-items: center;
text-decoration: none;
gap: 0.75rem;
font-weight: 700;
color: var(--kaauh-teal);
font-size: 1.25rem;
}
.nav-brand img { height: 45px; }
.nav-actions {
display: flex;
align-items: center;
gap: 1rem;
}
.nav-link {
text-decoration: none;
color: var(--gray-text);
font-weight: 500;
transition: color 0.2s;
}
.nav-link:hover { color: var(--kaauh-teal); }
/* --- BUTTONS --- */
.btn-lang {
background: transparent;
border: 1px solid var(--border);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
font-weight: 500;
color: var(--kaauh-teal);
transition: all 0.2s;
}
.btn-lang:hover { background: var(--kaauh-teal-light); }
/* --- DROPDOWN --- */
.dropdown { position: relative; }
.dropdown-trigger {
background: none;
border: none;
cursor: pointer;
display: flex;
align-items: center;
}
.profile-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
object-fit: cover;
border: 2px solid var(--kaauh-teal-light);
}
.dropdown-menu {
display: none;
position: absolute;
top: calc(100% + 10px);
inset-inline-end: 0;
background: var(--white);
min-width: 260px;
border-radius: 0.75rem;
box-shadow: var(--shadow);
border: 1px solid var(--border);
overflow: hidden;
z-index: 1100;
}
.dropdown.active .dropdown-menu { display: block; }
.dropdown-header {
padding: 1rem;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 0.75rem;
}
.dropdown-item {
display: flex;
align-items: center;
padding: 0.75rem 1rem;
text-decoration: none;
color: #444;
gap: 0.75rem;
transition: background 0.2s;
border: none;
background: none;
width: 100%;
text-align: inherit;
cursor: pointer;
font-size: 0.95rem;
}
.dropdown-item:hover { background: var(--kaauh-teal-light); }
.dropdown-item svg { width: 20px; height: 20px; color: var(--gray-text); }
.dropdown-item.logout { color: var(--danger); }
.dropdown-item.logout svg { color: var(--danger); }
/* --- ALERTS --- */
.alert-container {
max-width: 1200px;
margin: 1rem auto;
padding-inline: 1rem;
}
.alert {
padding: 1rem;
border-radius: 0.5rem;
background: #e7f3f4;
color: var(--kaauh-teal-dark);
border-inline-start: 4px solid var(--kaauh-teal);
margin-bottom: 0.75rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.heroicon { width: 20px; height: 20px; flex-shrink: 0; }
/* --- RESPONSIVE --- */
@media (max-width: 768px) {
.navbar { padding-inline: 1rem; }
.nav-brand span { display: none; }
.d-mobile-none { display: none; }
}
</style>
</head>
<body>
<nav class="navbar">
<a href="{% url 'kaauh_career' %}" class="nav-brand">
<img src="{% static 'image/kaauh.jpeg' %}" alt="KAAUH">
<span>KAAUH Careers</span>
</a>
<div class="nav-actions">
{% if request.resolver_match.url_name != "kaauh_career" %}
<a href="{% url 'kaauh_career' %}" class="nav-link d-mobile-none">{% trans "Careers" %}</a>
{% endif %}
<form action="{% url 'set_language' %}" method="post">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.get_full_path }}">
{% if LANGUAGE_CODE == 'en' %}
<button name="language" value="ar" class="btn-lang" type="submit">
🇸🇦 <span class="d-mobile-none">العربية</span>
</button>
{% else %}
<button name="language" value="en" class="btn-lang" type="submit">
🇺🇸 <span class="d-mobile-none">English</span>
</button>
{% endif %}
</form>
{% if request.user.is_authenticated %}
<div class="dropdown" id="userDropdown">
<button class="dropdown-trigger" onclick="toggleDropdown()">
{% if user.profile_image %}
<img src="{{ user.profile_image.url }}" class="profile-avatar">
{% else %}
<div class="profile-avatar" style="background: var(--kaauh-teal); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold;">
{{ user.username|first|upper }}
</div>
{% endif %}
</button>
<div class="dropdown-menu">
<div class="dropdown-header">
<div>
<div style="font-weight: 600;">{{ user.get_full_name|default:user.username }}</div>
<div style="font-size: 0.8rem; color: var(--gray-text);">{{ user.email|truncatechars:22 }}</div>
</div>
</div>
<a href="{% url 'applicant_portal_dashboard' %}" class="dropdown-item">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path></svg>
{% trans "Dashboard" %}
</a>
<a href="{% url 'user_detail' request.user.pk %}" class="dropdown-item">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
{% trans "My Profile" %}
</a>
<form method="post" action="{% url 'account_logout'%}">
{% csrf_token %}
<button type="submit" class="dropdown-item logout">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg>
{% trans "Sign Out" %}
</button>
</form>
</div>
</div>
{% endif %}
</div>
</nav>
{% if messages %}
<div class="alert-container">
{% for message in messages %}
<div class="alert">
<div style="display: flex; align-items: center; gap: 0.75rem;">
<svg class="heroicon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
{{ message }}
</div>
<button onclick="this.parentElement.remove()" style="background:none; border:none; cursor:pointer; font-size: 1.25rem;">&times;</button>
</div>
{% endfor %}
</div>
{% endif %}
<main>
{% block content %}{% endblock %}
</main>
<script>
function toggleDropdown() {
document.getElementById('userDropdown').classList.toggle('active');
}
// Close dropdown when clicking outside
window.addEventListener('click', function(e) {
if (!document.getElementById('userDropdown')?.contains(e.target)) {
document.getElementById('userDropdown')?.classList.remove('active');
}
});
</script>
{% block customJS %}{% endblock %}
</body>
</html>