agdar/ot/templates/ot/consult_list.html
Marwan Alwali a04817ef6e update
2025-11-02 19:25:08 +03:00

117 lines
4.5 KiB
HTML

{% extends "base.html" %}
{% load i18n static %}
{% block title %}{% trans "OT Consultations" %} - Tenhal{% endblock %}
{% block content %}
<div class="container-fluid">
<!-- Page Header -->
<div class="d-flex justify-content-between align-items-center mb-3">
<div>
<h1 class="page-header mb-0">
<i class="fas fa-hands-helping me-2"></i>{% trans "OT Consultations" %}
</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'core:dashboard' %}">{% trans "Dashboard" %}</a></li>
<li class="breadcrumb-item active">{% trans "OT Consultations" %}</li>
</ol>
</nav>
</div>
<div>
<a href="{% url 'ot:consult_create' %}" class="btn btn-primary">
<i class="fas fa-plus me-2"></i>{% trans "New Consultation" %}
</a>
</div>
</div>
<!-- Unsigned Consultations Alert -->
{% if unsigned_count > 0 %}
<div class="alert alert-warning alert-dismissible fade show mb-3" role="alert">
<h5 class="alert-heading">
<i class="fas fa-exclamation-triangle me-2"></i>{% trans "Unsigned Consultations" %}
</h5>
<p class="mb-2">
{% blocktrans count counter=unsigned_count %}
You have {{ counter }} unsigned consultation that requires your signature.
{% plural %}
You have {{ counter }} unsigned consultations that require your signature.
{% endblocktrans %}
</p>
{% if unsigned_items %}
<hr>
<p class="mb-2"><strong>{% trans "Recent unsigned consultations:" %}</strong></p>
<ul class="mb-0">
{% for item in unsigned_items %}
<li>
<a href="{% url 'ot:consult_detail' item.pk %}" class="alert-link">
{{ item.consultation_date|date:"Y-m-d" }} - {{ item.patient.first_name_en }} {{ item.patient.last_name_en }} ({{ item.patient.mrn }})
</a>
{% if item.provider != user %}
<small class="text-muted">- {% trans "Provider:" %} {{ item.provider.get_full_name }}</small>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
<!-- Search & Filter -->
<div class="card mb-3">
<div class="card-body">
<form method="get" class="row g-3">
<div class="col-md-4">
<input type="text" name="search" class="form-control"
placeholder="{% trans 'Search by patient name or MRN...' %}"
value="{{ request.GET.search }}">
</div>
<div class="col-md-2">
<input type="date" name="date_from" class="form-control"
placeholder="{% trans 'From Date' %}"
value="{{ request.GET.date_from }}">
</div>
<div class="col-md-2">
<input type="date" name="date_to" class="form-control"
placeholder="{% trans 'To Date' %}"
value="{{ request.GET.date_to }}">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary w-100">
<i class="fas fa-search me-2"></i>{% trans "Search" %}
</button>
</div>
<div class="col-md-2">
<a href="{% url 'ot:consult_list' %}" class="btn btn-outline-secondary w-100">
<i class="fas fa-redo me-2"></i>{% trans "Reset" %}
</a>
</div>
</form>
</div>
</div>
<!-- Consultations List -->
<div class="card">
<div class="card-body">
<div id="consult-list-container">
{% include 'ot/partials/consult_list_partial.html' %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script>
$(document).ready(function() {
// HTMX support for dynamic updates
htmx.on('htmx:afterSwap', function(event) {
if (event.detail.target.id === 'consult-list-container') {
console.log('Consultation list updated');
}
});
});
</script>
{% endblock %}