HH/templates/core/select_hospital.html
2026-02-22 08:35:53 +03:00

128 lines
6.4 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% block title %}{% trans "Select Hospital" %} - PX360{% endblock %}
{% block content %}
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Header -->
<div class="text-center mb-8">
<div class="inline-flex items-center justify-center w-20 h-20 bg-gradient-to-br from-blue-500 to-navy rounded-2xl mb-4 shadow-lg">
<i data-lucide="building-2" class="w-10 h-10 text-white"></i>
</div>
<h1 class="text-3xl font-bold text-navy mb-3">
{% trans "Select Hospital" %}
</h1>
<p class="text-slate text-lg max-w-2xl mx-auto">
{% trans "As a PX Admin, you can view and manage data for any hospital. Please select the hospital you want to work with:" %}
</p>
</div>
<!-- Hospital Selection Form -->
<div class="bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden">
<form method="post">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
<div class="divide-y divide-slate-100">
{% for hospital in hospitals %}
<div class="block cursor-pointer hover:bg-light/30 transition group relative">
<input type="radio"
id="hospital_{{ hospital.id }}"
name="hospital_id"
value="{{ hospital.id }}"
{% if hospital.id == selected_hospital_id %}checked{% endif %}
class="peer"
style="position: absolute; opacity: 0; width: 0; height: 0;">
<label for="hospital_{{ hospital.id }}" class="block p-6">
<div class="flex items-start gap-4">
<!-- Radio Button -->
<div class="flex-shrink-0 mt-1">
<div class="w-5 h-5 rounded-full border-2 border-slate-300 peer-checked:border-blue peer-checked:bg-blue flex items-center justify-center transition-all">
<div class="w-2.5 h-2.5 bg-white rounded-full opacity-0 peer-checked:opacity-100 transition-opacity"></div>
</div>
</div>
<!-- Hospital Info -->
<div class="flex-1 min-w-0">
<div class="flex items-start justify-between gap-4">
<div class="flex-1">
<h3 class="text-lg font-bold text-navy mb-1 group-hover:text-blue transition">
{{ hospital.name }}
</h3>
{% if hospital.city %}
<p class="text-slate text-sm flex items-center gap-1.5">
<i data-lucide="map-pin" class="w-3.5 h-3.5"></i>
{{ hospital.city }}
{% if hospital.country %}, {{ hospital.country }}{% endif %}
</p>
{% endif %}
</div>
<!-- Selected Badge -->
{% if hospital.id == selected_hospital_id %}
<span class="inline-flex items-center px-3 py-1.5 rounded-lg text-xs font-bold bg-green-100 text-green-800 flex-shrink-0">
<i data-lucide="check-circle-2" class="w-3.5 h-3.5 mr-1.5"></i>
{% trans "Selected" %}
</span>
{% endif %}
</div>
</div>
</div>
</label>
</div>
{% empty %}
<div class="p-12 text-center">
<div class="inline-flex items-center justify-center w-16 h-16 bg-amber-50 rounded-full mb-4">
<i data-lucide="alert-triangle" class="w-8 h-8 text-amber-500"></i>
</div>
<h3 class="text-lg font-semibold text-navy mb-2">
{% trans "No Hospitals Available" %}
</h3>
<p class="text-slate text-sm">
{% trans "No hospitals found in the system. Please contact your administrator." %}
</p>
</div>
{% endfor %}
</div>
<!-- Action Buttons -->
<div class="p-6 bg-slate-50 border-t border-slate-200">
<div class="flex flex-col sm:flex-row justify-between items-center gap-4">
<a href="/" class="w-full sm:w-auto px-6 py-3 border border-slate-200 text-slate rounded-xl font-semibold hover:bg-white transition flex items-center justify-center gap-2">
<i data-lucide="arrow-left" class="w-5 h-5"></i>
{% trans "Back to Dashboard" %}
</a>
<button type="submit" class="w-full sm:w-auto px-8 py-3 bg-gradient-to-r from-blue to-navy text-white rounded-xl font-semibold hover:from-navy hover:to-blue transition flex items-center justify-center gap-2 shadow-lg shadow-blue/20">
<i data-lucide="check" class="w-5 h-5"></i>
{% trans "Continue" %}
</button>
</div>
</div>
</form>
</div>
<!-- Info Banner -->
<div class="bg-blue-50 border border-blue-200 rounded-2xl p-4 mt-6">
<div class="flex items-start gap-3">
<i data-lucide="info" class="w-5 h-5 text-blue-600 mt-0.5 flex-shrink-0"></i>
<div>
<p class="text-sm font-semibold text-blue-800 mb-1">
{% trans "Tip" %}
</p>
<p class="text-xs text-blue-700">
{% trans "You can change your selected hospital at any time by clicking on the hospital name in the top navigation bar." %}
</p>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
lucide.createIcons();
});
</script>
{% endblock %}