kaauh_ats/templates/portal_base.html
2025-12-24 03:05:48 +03:00

200 lines
9.9 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">
<meta name="description" content="{% trans 'King Abdullah Academic University Hospital - Portal' %}">
<title>{% block title %}{% trans 'KAAUH Portal' %}{% endblock %}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'image/favicon/apple-touch-icon.png'%}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'image/favicon/favicon-32x32.png'%}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'image/favicon/favicon-16x16.png'%}">
<link rel="manifest" href="{% static 'image/favicon/site.webmanifest'%}">
{% if LANGUAGE_CODE == 'ar' %}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.rtl.min.css" rel="stylesheet">
{% else %}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
{% endif %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" />
<link rel="stylesheet" href="{% static 'css/main.css' %}">
{% block customCSS %}{% endblock %}
</head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
<aside class="sidebar d-flex flex-column" id="sidebar">
<div class="sidebar-brand">
<img src="{% static 'image/kaauh_green1.png' %}" alt="Logo" style="width: 50px;">
<div class="text-white small mt-2 fw-bold">
{% if request.user.user_type == 'agency' %}{% trans "Agency Portal" %}{% else %}{% trans "Candidate Portal" %}{% endif %}
</div>
</div>
<nav class="sidebar-nav">
{% if request.user.user_type == 'agency' %}
<a class="nav-link-custom {% if 'dashboard' in request.path %}active{% endif %}" href="{% url 'agency_portal_dashboard' %}">
<i class="fas fa-th-large me-2"></i> {% trans "Dashboard" %}
</a>
<a class="nav-link-custom {% if 'persons' in request.path %}active{% endif %}" href="{% url 'agency_portal_persons_list' %}">
<i class="fas fa-users me-2"></i> {% trans "Applicants" %}
</a>
{% else %}
<a class="nav-link-custom {% if 'dashboard' in request.path %}active{% endif %}" href="{% url 'applicant_portal_dashboard' %}">
<i class="fas fa-th-large me-2"></i> {% trans "Dashboard" %}
</a>
<a class="nav-link-custom {% if 'career' in request.path %}active{% endif %}" href="{% url 'kaauh_career' %}">
<i class="fas fa-briefcase me-2"></i> {% trans "Careers" %}
</a>
{% endif %}
<a class="nav-link-custom {% if 'message' in request.path %}active{% endif %}" href="{% url 'message_list' %}">
<i class="fas fa-envelope me-2"></i> {% trans "Messages" %}
{% if request.user.get_unread_message_count > 0 %}
<span class="badge rounded-pill bg-danger ms-auto">{{ request.user.get_unread_message_count }}</span>
{% endif %}
</a>
<div class="mt-auto">
<div class="mt-4 pt-3 border-top border-secondary mx-3">
<small class="text-white-50 px-2 uppercase">{% trans "Account" %}</small>
</div>
<a class="nav-link-custom {% if 'profile' in request.path %}active{% endif %}" href="{% url 'user_detail' request.user.pk %}">
<i class="fas fa-user-circle me-2"></i> {% trans "My Profile" %}
</a>
</div>
</nav>
<div class="p-3 border-top border-secondary">
<form method="post" action="{% url 'account_logout'%}">
{% csrf_token %}
<button type="submit" class="btn btn-link text-danger text-decoration-none p-0 w-100 text-start">
<i class="fas fa-sign-out-alt me-2"></i> {% trans "Sign Out" %}
</button>
</form>
</div>
<div class="mt-auto p-3 border-top border-secondary text-center">
<a href="https://tenhal.sa/" class="text-decoration-none" target="_blank">
<div class="text-white-50" style="font-size: 0.7rem; letter-spacing: 0.5px;">
{% trans "POWERED BY" %}
<span class="text-white fw-bold">TENHAL</span>
</div>
</a>
</div>
</aside>
<div class="main-wrapper">
<header class="content-header justify-content-between">
<div class="d-flex align-items-center">
<button class="btn d-lg-none me-2" onclick="document.getElementById('sidebar').classList.toggle('show')">
<i class="fas fa-bars"></i>
</button>
<div class="hospital-text d-none d-md-block">
<small class="text-teal fw-bold">
{% if request.user.user_type == 'agency' %}
{% trans "Agency Portal" %}
{% else %}
{% trans "Applicant Portal" %}
{% endif %}
<span class="text-muted mx-2">|</span>
<span class="text-secondary">KAAUH</span>
</small>
</div>
</div>
<div class="d-flex align-items-center gap-3">
<a href="{% url 'message_list' %}" class="btn btn-sm btn-outline-secondary position-relative d-flex align-items-center justify-content-center" style="width: 36px; height: 36px; border-radius: 8px;">
<i class="fas fa-envelope"></i>
{% if request.user.get_unread_message_count > 0 %}
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger" style="font-size: 0.65rem;">
{{ request.user.get_unread_message_count }}
</span>
{% endif %}
</a>
{% if LANGUAGE_CODE == 'en' %}
<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
<input name="language" type="hidden" value="ar">
<input name="next" type="hidden" value="{{ request.get_full_path }}">
<button class="btn btn-sm btn-outline-secondary" type="submit">🇸🇦 العربية</button>
</form>
{% else %}
<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
<input name="language" type="hidden" value="en">
<input name="next" type="hidden" value="{{ request.get_full_path }}">
<button class="btn btn-sm btn-outline-secondary" type="submit">🇺🇸 English</button>
</form>
{% endif %}
<div class="dropdown">
<button class="btn p-0 border-0 d-flex align-items-center" data-bs-toggle="dropdown" aria-expanded="false">
<div class="profile-avatar shadow-sm" style="width: 36px; height: 36px; font-size: 0.85rem; border: 2px solid white;">
{{ user.username|first|upper }}
</div>
</button>
<ul class="dropdown-menu dropdown-menu-end shadow border-0 mt-2">
<li class="px-3 py-2 border-bottom">
<div class="fw-bold small text-dark">{{ user.get_full_name|default:user.username }}</div>
<div class="text-muted" style="font-size: 0.75rem;">{{ user.email|truncatechars:22 }}</div>
</li>
<li><a class="dropdown-item mt-1" href="{% url 'user_detail' request.user.pk %}"><i class="fas fa-user-circle me-2 text-muted"></i>{% trans "My Profile" %}</a></li>
<li><hr class="dropdown-divider"></li>
<li>
<form method="post" action="{% url 'account_logout'%}" class="m-0">
{% csrf_token %}
<button type="submit" class="dropdown-item text-danger d-flex align-items-center">
<i class="fas fa-sign-out-alt me-2"></i>{% trans "Sign Out" %}
</button>
</form>
</li>
</ul>
</div>
</div>
</header>
<main class="main-container">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% block content %}{% endblock %}
</main>
<footer class="mt-auto py-3 border-top bg-white">
<div class="container-fluid px-4">
<div class="d-flex justify-content-between align-items-center small text-muted">
<span>&copy; {% now "Y" %} KAAUH. {% trans "All rights reserved." %}</span>
<div class="d-flex gap-3">
<img src="{% static 'image/vision.svg' %}" alt="Vision 2030" style="height: 25px;">
</div>
</div>
</div>
</footer>
</div>
<div class="text-center mt-4 powered-by-footer">
<a href="https://tenhal.sa/" class="text-decoration-none" target="_blank">
<p class="text-muted small">
Tenhal | تنحل
</p>
<a>
</div>
{% include 'includes/delete_modal.html' %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.7/dist/htmx.min.js"></script>
{% block customJS %}{% endblock %}
</body>
</html>