229 lines
11 KiB
HTML
229 lines
11 KiB
HTML
{% extends 'layouts/base.html' %}
|
|
{% load i18n static %}
|
|
|
|
{% block title %}{% trans "Search Standards" %}{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
:root {
|
|
--hh-navy: #005696;
|
|
--hh-blue: #007bbd;
|
|
--hh-light: #eef6fb;
|
|
--hh-slate: #64748b;
|
|
}
|
|
|
|
.page-header-gradient {
|
|
background: linear-gradient(135deg, var(--hh-navy) 0%, #0069a8 50%, var(--hh-blue) 100%);
|
|
color: white;
|
|
padding: 1.5rem 2rem;
|
|
border-radius: 1rem;
|
|
margin-bottom: 1.5rem;
|
|
box-shadow: 0 10px 15px -3px rgba(0, 86, 150, 0.2);
|
|
}
|
|
|
|
.section-card {
|
|
background: white;
|
|
border-radius: 1rem;
|
|
border: 2px solid #e2e8f0;
|
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
overflow: hidden;
|
|
transition: all 0.3s ease;
|
|
}
|
|
.section-card:hover {
|
|
border-color: #005696;
|
|
box-shadow: 0 10px 25px -5px rgba(0, 86, 150, 0.15);
|
|
}
|
|
|
|
.section-header {
|
|
padding: 1rem 1.5rem;
|
|
border-bottom: 2px solid #e2e8f0;
|
|
background: linear-gradient(to right, #f8fafc, #f1f5f9);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.section-icon {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 0.75rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.btn-transition {
|
|
transition: all 0.2s ease-in-out;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="px-6 py-4">
|
|
<div class="page-header-gradient">
|
|
<div class="flex justify-between items-center">
|
|
<div>
|
|
<h1 class="text-2xl font-bold mb-1">{% trans "Search Standards" %}</h1>
|
|
<p class="text-blue-100 text-sm">{{ hospital.name }}</p>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
{% if is_px_admin %}
|
|
<a href="{% url 'standards:standard_create_global' %}" class="btn-transition inline-flex items-center px-4 py-2.5 bg-green-500 text-white font-medium rounded-xl hover:bg-green-600 transition">
|
|
<i data-lucide="plus" class="w-4 h-4 me-2"></i>{% trans "Create Standard" %}
|
|
</a>
|
|
{% endif %}
|
|
<a href="{% url 'standards:dashboard' %}" class="btn-transition inline-flex items-center px-4 py-2.5 bg-white/10 border-2 border-white/30 text-white font-medium rounded-xl hover:bg-white hover:text-navy transition">
|
|
<i data-lucide="arrow-left" class="w-4 h-4 me-2"></i>{% trans "Back to Dashboard" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-card mb-6">
|
|
<div class="section-header">
|
|
<div class="section-icon bg-navy/10">
|
|
<i data-lucide="search" class="w-5 h-5 text-navy"></i>
|
|
</div>
|
|
<h5 class="text-lg font-semibold text-gray-800">{% trans "Search Filters" %}</h5>
|
|
</div>
|
|
<div class="p-6">
|
|
<form method="get" class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
|
<div class="md:col-span-2">
|
|
<label for="q" class="block text-sm font-medium text-gray-700 mb-2">{% trans "Search" %}</label>
|
|
<input type="text"
|
|
class="w-full px-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-navy focus:border-transparent transition"
|
|
name="q"
|
|
id="q"
|
|
value="{{ query }}"
|
|
placeholder="{% trans 'Search by code, title, or description...' %}">
|
|
</div>
|
|
<div>
|
|
<label for="source" class="block text-sm font-medium text-gray-700 mb-2">{% trans "Source" %}</label>
|
|
<select class="w-full px-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-navy focus:border-transparent transition"
|
|
name="source"
|
|
id="source">
|
|
<option value="">{% trans "All Sources" %}</option>
|
|
{% for source in sources %}
|
|
<option value="{{ source.id }}" {% if source_filter == source.id|stringformat:"s" %}selected{% endif %}>
|
|
{{ source.name }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="category" class="block text-sm font-medium text-gray-700 mb-2">{% trans "Category" %}</label>
|
|
<select class="w-full px-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-navy focus:border-transparent transition"
|
|
name="category"
|
|
id="category">
|
|
<option value="">{% trans "All Categories" %}</option>
|
|
{% for category in categories %}
|
|
<option value="{{ category.id }}" {% if category_filter == category.id|stringformat:"s" %}selected{% endif %}>
|
|
{{ category.name }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="md:col-span-4 flex gap-3">
|
|
<button type="submit" class="btn-transition inline-flex items-center px-6 py-2.5 bg-navy text-white font-medium rounded-xl hover:bg-blue transition">
|
|
<i data-lucide="search" class="w-4 h-4 me-2"></i>{% trans "Search" %}
|
|
</button>
|
|
<a href="{% url 'standards:search' %}" class="btn-transition inline-flex items-center px-6 py-2.5 bg-gray-100 text-gray-700 font-medium rounded-xl hover:bg-gray-200 transition">
|
|
{% trans "Clear" %}
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-card">
|
|
<div class="section-header">
|
|
<div class="section-icon bg-blue/10">
|
|
<i data-lucide="clipboard-list" class="w-5 h-5 text-blue"></i>
|
|
</div>
|
|
<h5 class="text-lg font-semibold text-gray-800">
|
|
{% if query or source_filter or category_filter %}
|
|
{% trans "Search Results" %} ({{ standards.count }})
|
|
{% else %}
|
|
{% trans "All Standards" %} ({{ standards.count }})
|
|
{% endif %}
|
|
</h5>
|
|
</div>
|
|
<div class="p-0">
|
|
{% if standards %}
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
{% trans "Code" %}
|
|
</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
{% trans "Title" %}
|
|
</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
{% trans "Source" %}
|
|
</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
{% trans "Category" %}
|
|
</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
{% trans "Department" %}
|
|
</th>
|
|
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
{% trans "Actions" %}
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
{% for standard in standards %}
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-6 py-4 whitespace-nowrap">
|
|
<span class="inline-flex items-center px-3 py-1 rounded-lg text-xs font-semibold bg-navy/10 text-navy">
|
|
{{ standard.code }}
|
|
</span>
|
|
</td>
|
|
<td class="px-6 py-4">
|
|
<a href="{% url 'standards:standard_detail' pk=standard.id %}" class="text-sm font-medium text-gray-900 hover:text-navy transition">
|
|
{{ standard.title }}
|
|
</a>
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
|
{{ standard.source.name }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
|
{{ standard.category.name }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
|
{% if standard.department %}
|
|
{{ standard.department.name }}
|
|
{% else %}
|
|
<span class="text-gray-400 italic">{% trans "All Departments" %}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-right">
|
|
<a href="{% url 'standards:standard_detail' pk=standard.id %}"
|
|
class="btn-transition inline-flex items-center px-3 py-1.5 bg-navy text-white text-xs font-medium rounded-lg hover:bg-blue transition">
|
|
<i data-lucide="eye" class="w-3 h-3 me-1"></i>{% trans "View" %}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="text-center py-12 text-gray-500">
|
|
<i data-lucide="search-x" class="w-16 h-16 mx-auto mb-4 text-gray-300"></i>
|
|
<p class="text-lg mb-4">{% trans "No standards found" %}</p>
|
|
{% if query or source_filter or category_filter %}
|
|
<a href="{% url 'standards:search' %}" class="btn-transition inline-flex items-center px-6 py-2.5 bg-navy text-white font-medium rounded-xl hover:bg-blue transition mx-auto">
|
|
<i data-lucide="refresh-cw" class="w-4 h-4 me-2"></i>{% trans "Clear Filters" %}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|