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

83 lines
3.5 KiB
HTML

{% load i18n patient_tags %}
{% if sessions %}
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-light">
<tr>
<th>{% trans "Date" %}</th>
<th>{% trans "Patient" %}</th>
<th>{% trans "Type" %}</th>
<th>{% trans "Cooperative" %}</th>
<th>{% trans "Distraction" %}</th>
<th>{% trans "Provider" %}</th>
<th>{% trans "Signature" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for session in sessions %}
<tr>
<td>{{ session.session_date|date:"M d, Y" }}</td>
<td>
<a href="{% url 'core:patient_detail' session.patient.pk %}">
{% patient_name session.patient %}
</a>
<br>
<small class="text-muted">{{ session.patient.mrn }}</small>
</td>
<td>
<span class="badge bg-primary">{{ session.get_session_type_display }}</span>
</td>
<td>
{% if session.cooperative_level %}
<span class="badge {% if session.cooperative_level >= 3 %}bg-success{% elif session.cooperative_level == 2 %}bg-warning{% else %}bg-danger{% endif %}">
{{ session.cooperative_level }}/4
</span>
{% else %}
<span class="text-muted">-</span>
{% endif %}
</td>
<td>
{% if session.distraction_tolerance %}
<span class="badge {% if session.distraction_tolerance >= 3 %}bg-success{% elif session.distraction_tolerance == 2 %}bg-warning{% else %}bg-danger{% endif %}">
{{ session.distraction_tolerance }}/4
</span>
{% else %}
<span class="text-muted">-</span>
{% endif %}
</td>
<td>{{ session.provider.get_full_name }}</td>
<td>
{% if session.signed_by %}
<span class="badge bg-success" title="{% trans 'Signed by' %} {{ session.signed_by.get_full_name }} {% trans 'on' %} {{ session.signed_at|date:'Y-m-d H:i' }}">
<i class="fas fa-check-circle me-1"></i>{% trans "Signed" %}
</span>
{% else %}
<span class="badge bg-warning text-dark" title="{% trans 'Not signed' %}">
<i class="fas fa-exclamation-triangle me-1"></i>{% trans "Unsigned" %}
</span>
{% endif %}
</td>
<td>
<a href="{% url 'ot:session_detail' session.pk %}" class="btn btn-sm btn-outline-primary">
<i class="fas fa-eye"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
{% include "includes/pagination_unified.html" %}
{% endif %}
</div>
{% else %}
<div class="text-center py-5">
<i class="fas fa-clipboard-check fa-3x text-muted mb-3"></i>
<h5 class="text-muted">{% trans "No sessions found" %}</h5>
<p class="text-muted">{% trans "Start by creating a new session" %}</p>
</div>
{% endif %}