HH/templates/surveys/template_list.html
2025-12-29 11:52:54 +03:00

103 lines
4.3 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% load static %}
{% block title %}Survey Templates - PX360{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h2 class="mb-1">
<i class="bi bi-clipboard2 text-info me-2"></i>
Survey Templates
</h2>
<p class="text-muted mb-0">Manage survey templates and questions</p>
</div>
</div>
<div class="card">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="table-light">
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Survey Type" %}</th>
<th>{% trans "Hospital" %}</th>
<th>{% trans "Questions" %}</th>
<th>{% trans "Scoring" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for template in templates %}
<tr>
<td><strong>{{ template.name }}</strong></td>
<td><span class="badge bg-info">{{ template.get_survey_type_display }}</span></td>
<td><small>{{ template.hospital.name_en }}</small></td>
<td><span class="badge bg-secondary">{{ template.questions.count }} questions</span></td>
<td><small>{{ template.get_scoring_method_display }}</small></td>
<td>
{% if template.is_active %}
<span class="badge bg-success">Active</span>
{% else %}
<span class="badge bg-secondary">Inactive</span>
{% endif %}
</td>
<td>
<a href="{% url 'surveys:instance_list' %}?survey_type={{ template.survey_type }}"
class="btn btn-sm btn-outline-primary">
View Instances
</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="7" class="text-center py-5">
<i class="bi bi-inbox" style="font-size: 3rem; color: #ccc;"></i>
<p class="text-muted mt-3">No templates found</p>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% if page_obj.has_other_pages %}
<nav aria-label="Templates pagination" class="mt-4">
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">
<i class="bi bi-chevron-left"></i>
</a>
</li>
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
<li class="page-item active"><span class="page-link">{{ num }}</span></li>
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
<li class="page-item">
<a class="page-link" href="?page={{ num }}">{{ num }}</a>
</li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link" href="?page={{ page_obj.next_page_number }}">
<i class="bi bi-chevron-right"></i>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
</div>
{% endblock %}