120 lines
5.0 KiB
HTML
120 lines
5.0 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n static %}
|
|
|
|
{% block title %}{% trans "OT Sessions" %} - Tenhal{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div>
|
|
<h1 class="page-header mb-0">
|
|
<i class="fas fa-clipboard-check me-2"></i>{% trans "OT Sessions" %}
|
|
</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 Sessions" %}</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
<div>
|
|
<a href="{% url 'ot:session_create' %}" class="btn btn-primary">
|
|
<i class="fas fa-plus me-2"></i>{% trans "New Session" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Unsigned Sessions 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 Sessions" %}
|
|
</h5>
|
|
<p class="mb-2">
|
|
{% blocktrans count counter=unsigned_count %}
|
|
You have {{ counter }} unsigned session that requires your signature.
|
|
{% plural %}
|
|
You have {{ counter }} unsigned sessions that require your signature.
|
|
{% endblocktrans %}
|
|
</p>
|
|
{% if unsigned_items %}
|
|
<hr>
|
|
<p class="mb-2"><strong>{% trans "Recent unsigned sessions:" %}</strong></p>
|
|
<ul class="mb-0">
|
|
{% for item in unsigned_items %}
|
|
<li>
|
|
<a href="{% url 'ot:session_detail' item.pk %}" class="alert-link">
|
|
{{ item.session_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-3">
|
|
<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">
|
|
<select name="session_type" class="form-select">
|
|
<option value="">{% trans "All Types" %}</option>
|
|
<option value="CONSULT" {% if request.GET.session_type == "CONSULT" %}selected{% endif %}>{% trans "Consultation" %}</option>
|
|
<option value="INDIVIDUAL" {% if request.GET.session_type == "INDIVIDUAL" %}selected{% endif %}>{% trans "Individual" %}</option>
|
|
<option value="GROUP" {% if request.GET.session_type == "GROUP" %}selected{% endif %}>{% trans "Group" %}</option>
|
|
<option value="PARENT_TRAINING" {% if request.GET.session_type == "PARENT_TRAINING" %}selected{% endif %}>{% trans "Parent Training" %}</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="date" name="date_from" class="form-control" value="{{ request.GET.date_from }}">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="date" name="date_to" class="form-control" value="{{ request.GET.date_to }}">
|
|
</div>
|
|
<div class="col-md-1">
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
<i class="fas fa-search"></i>
|
|
</button>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<a href="{% url 'ot:session_list' %}" class="btn btn-outline-secondary w-100">
|
|
<i class="fas fa-redo me-2"></i>{% trans "Reset" %}
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sessions List -->
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div id="session-list-container">
|
|
{% include 'ot/partials/session_list_partial.html' %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
<script>
|
|
$(document).ready(function() {
|
|
htmx.on('htmx:afterSwap', function(event) {
|
|
if (event.detail.target.id === 'session-list-container') {
|
|
console.log('Session list updated');
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|