232 lines
14 KiB
HTML
232 lines
14 KiB
HTML
{% extends "base.html" %}
|
|
{% load static i18n %}
|
|
|
|
{% block title %}{% trans "Hiring Agencies" %} - {{ block.super }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="space-y-6">
|
|
|
|
<!-- Desktop Header -->
|
|
<div class="hidden lg:block">
|
|
<!-- Breadcrumb -->
|
|
<nav class="mb-6" aria-label="breadcrumb">
|
|
<ol class="flex items-center gap-2 text-sm flex-wrap">
|
|
<li><a href="{% url 'dashboard' %}" class="text-gray-500 hover:text-temple-red transition flex items-center gap-1">
|
|
<i data-lucide="home" class="w-4 h-4"></i> {% trans "Home" %}
|
|
</a></li>
|
|
<li class="text-gray-400">/</li>
|
|
<li class="text-temple-red font-semibold">{% trans "Hiring Agencies" %}</li>
|
|
</ol>
|
|
</nav>
|
|
|
|
<div class="flex justify-between items-start mb-6">
|
|
<h1 class="text-3xl font-bold text-gray-900 flex items-center gap-3">
|
|
<div class="bg-temple-red/10 p-3 rounded-xl">
|
|
<i data-lucide="building" class="w-8 h-8 text-temple-red"></i>
|
|
</div>
|
|
{% trans "Hiring Agencies" %}
|
|
</h1>
|
|
<div class="flex gap-3">
|
|
<a href="{% url 'agency_assignment_list' %}" class="inline-flex items-center gap-2 border border-temple-red text-temple-red hover:bg-temple-red hover:text-white font-semibold px-6 py-2.5 rounded-xl transition">
|
|
<i data-lucide="list" class="w-4 h-4"></i> {% trans "View Assignments" %}
|
|
</a>
|
|
<a href="{% url 'agency_create' %}" class="inline-flex items-center gap-2 bg-temple-red hover:bg-[#7a1a29] text-white font-semibold px-6 py-2.5 rounded-xl transition shadow-sm hover:shadow-md">
|
|
<i data-lucide="plus" class="w-4 h-4"></i> {% trans "Add Agency" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Desktop Filters -->
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden mb-6">
|
|
<div class="bg-gradient-to-br from-temple-red to-[#7a1a29] text-white p-4">
|
|
<h5 class="text-lg font-bold flex items-center gap-2">
|
|
<i data-lucide="filter" class="w-5 h-5"></i>
|
|
{% trans "Filter Agencies" %}
|
|
</h5>
|
|
</div>
|
|
<div class="p-6">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div>
|
|
<label for="search" class="block text-xs font-semibold text-gray-600 mb-2">{% trans "Search by Name, Contact, or Email" %}</label>
|
|
{% include 'includes/search_form.html' %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile Header -->
|
|
<div class="lg:hidden mb-4">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h1 class="text-2xl font-bold text-gray-900 flex items-center gap-2">
|
|
<div class="bg-temple-red/10 p-2 rounded-lg">
|
|
<i data-lucide="building" class="w-6 h-6 text-temple-red"></i>
|
|
</div>
|
|
{% trans "Hiring Agencies" %}
|
|
</h1>
|
|
<a href="{% url 'agency_create' %}" class="inline-flex items-center gap-2 bg-temple-red hover:bg-[#7a1a29] text-white font-semibold px-4 py-2.5 rounded-xl text-sm transition shadow-sm">
|
|
<i data-lucide="plus" class="w-4 h-4"></i> {% trans "Add" %}
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Mobile Filters -->
|
|
<div class="space-y-3">
|
|
<div>
|
|
<label for="search" class="block text-xs font-semibold text-gray-600 mb-2">{% trans "Search Agencies" %}</label>
|
|
{% include 'includes/search_form.html' %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if page_obj %}
|
|
{# --- MOBILE CARD VIEW --- #}
|
|
<div class="lg:hidden grid grid-cols-1 gap-4">
|
|
{% for agency in page_obj %}
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
|
<div class="bg-gradient-to-br from-temple-red to-[#7a1a29] text-white p-4">
|
|
<div class="flex justify-between items-start">
|
|
<h5 class="font-bold text-lg">{{ agency.name }}</h5>
|
|
{% if agency.email %}
|
|
<a href="mailto:{{ agency.email }}" class="text-white/80 hover:text-white transition" title="{{ agency.email }}">
|
|
<i data-lucide="mail" class="w-5 h-5"></i>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="p-4 space-y-3">
|
|
{% if agency.contact_person %}
|
|
<div class="flex items-center gap-2 text-sm text-gray-600">
|
|
<i data-lucide="user" class="w-4 h-4 text-temple-red"></i>
|
|
<span>{{ agency.contact_person }}</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if agency.phone %}
|
|
<div class="flex items-center gap-2 text-sm text-gray-600">
|
|
<i data-lucide="phone" class="w-4 h-4 text-temple-red"></i>
|
|
<span>{{ agency.phone }}</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if agency.country %}
|
|
<div class="flex items-center gap-2 text-sm text-gray-600">
|
|
<i data-lucide="globe" class="w-4 h-4 text-temple-red"></i>
|
|
<span>{{ agency.get_country_display }}</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if agency.website %}
|
|
<div class="flex items-center gap-2 text-sm text-gray-600">
|
|
<i data-lucide="link" class="w-4 h-4 text-temple-red"></i>
|
|
<a href="{{ agency.website }}" target="_blank" class="text-temple-red hover:text-[#7a1a29] transition">
|
|
{{ agency.website|truncatechars:30 }}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Actions -->
|
|
<div class="flex gap-2 pt-3 border-t border-gray-100">
|
|
<a href="{% url 'agency_detail' agency.slug %}" class="flex-1 inline-flex items-center justify-center gap-2 bg-temple-red hover:bg-[#7a1a29] text-white font-medium px-4 py-2.5 rounded-xl text-sm transition">
|
|
<i data-lucide="eye" class="w-4 h-4"></i> {% trans "View" %}
|
|
</a>
|
|
<a href="{% url 'agency_update' agency.slug %}" class="inline-flex items-center justify-center gap-2 border border-gray-300 text-gray-600 hover:bg-gray-50 px-4 py-2.5 rounded-xl text-sm transition">
|
|
<i data-lucide="edit-2" class="w-4 h-4"></i> {% trans "Edit" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{# --- DESKTOP TABLE VIEW --- #}
|
|
<div class="hidden lg:block bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
|
<div class="bg-gradient-to-br from-temple-red to-[#7a1a29] text-white p-4">
|
|
<h5 class="text-lg font-bold flex items-center gap-2">
|
|
<i data-lucide="list" class="w-5 h-5"></i>
|
|
{% trans "Agency Listings" %}
|
|
</h5>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Agency Name" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Contact Person" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Email" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Phone" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Country" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Website" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Created" %}</th>
|
|
<th scope="col" class="px-6 py-3 text-center text-xs font-bold text-gray-700 tracking-wider whitespace-nowrap">{% trans "Actions" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-100">
|
|
{% for agency in page_obj %}
|
|
<tr class="hover:bg-gray-50 transition-colors">
|
|
<td class="px-6 py-4">
|
|
<a href="{% url 'agency_detail' agency.slug %}" class="text-temple-red font-semibold hover:text-[#7a1a29] transition-colors">{{ agency.name }}</a>
|
|
</td>
|
|
<td class="px-6 py-4 text-sm text-gray-700">{{ agency.contact_person|default:"-" }}</td>
|
|
<td class="px-6 py-4 text-sm text-gray-700">
|
|
{% if agency.email %}
|
|
<a href="mailto:{{ agency.email }}" class="text-temple-red hover:text-[#7a1a29] transition">
|
|
{{ agency.email|truncatechars:30 }}
|
|
</a>
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
<td class="px-6 py-4 text-sm text-gray-700">{{ agency.phone|default:"-" }}</td>
|
|
<td class="px-6 py-4 text-sm text-gray-700">{{ agency.get_country_display|default:"-" }}</td>
|
|
<td class="px-6 py-4 text-sm text-gray-700">
|
|
{% if agency.website %}
|
|
<a href="{{ agency.website }}" target="_blank" class="text-temple-red hover:text-[#7a1a29] transition">
|
|
{{ agency.website|truncatechars:25 }}
|
|
</a>
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
<td class="px-6 py-4 text-sm text-gray-700">{{ agency.created_at|date:"d-m-Y" }}</td>
|
|
<td class="px-6 py-4 text-center">
|
|
<div class="flex items-center justify-center gap-2">
|
|
<a href="{% url 'agency_detail' agency.slug %}" class="inline-flex items-center justify-center w-9 h-9 rounded-lg bg-temple-red hover:bg-[#7a1a29] text-white transition" title="{% trans 'View' %}">
|
|
<i data-lucide="eye" class="w-4 h-4"></i>
|
|
</a>
|
|
<a href="{% url 'agency_update' agency.slug %}" class="inline-flex items-center justify-center w-9 h-9 rounded-lg border border-gray-300 hover:bg-gray-100 text-gray-600 transition" title="{% trans 'Edit' %}">
|
|
<i data-lucide="edit-2" class="w-4 h-4"></i>
|
|
</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
{% include "includes/paginator.html" %}
|
|
{% else %}
|
|
<!-- No Results -->
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-12 text-center">
|
|
<i data-lucide="building" class="w-16 h-16 text-temple-red mx-auto mb-4"></i>
|
|
<h3 class="text-xl font-semibold text-gray-900 mb-2">{% trans "No Hiring Agencies Found" %}</h3>
|
|
<p class="text-gray-500 mb-6">
|
|
{% if search_query %}
|
|
{% trans "We couldn't find any agencies matching your search criteria." %}
|
|
{% else %}
|
|
{% trans "There are no hiring agencies in the system yet." %}
|
|
{% endif %}
|
|
</p>
|
|
<a href="{% url 'agency_create' %}" class="inline-flex items-center gap-2 bg-temple-red hover:bg-[#7a1a29] text-white font-semibold px-6 py-3 rounded-xl transition shadow-sm hover:shadow-md">
|
|
<i data-lucide="plus" class="w-5 h-5"></i>
|
|
{% trans "Add First Agency" %}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<script>
|
|
lucide.createIcons();
|
|
</script>
|
|
{% endblock %} |