222 lines
13 KiB
HTML
222 lines
13 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Quality Indicators - {{ block.super }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<!-- Page Header -->
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h2><i class="fas fa-chart-line me-2"></i>Quality Indicators</h2>
|
|
<p class="text-muted">Monitor and track key performance indicators for quality management</p>
|
|
</div>
|
|
<div>
|
|
<a href="{% url 'quality:dashboard' %}" class="btn btn-outline-secondary">
|
|
<i class="fas fa-arrow-left me-2"></i>Back to Dashboard
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<form method="get" class="row g-3">
|
|
<div class="col-md-3">
|
|
<label for="category" class="form-label">Category</label>
|
|
<select name="category" id="category" class="form-select">
|
|
<option value="">All Categories</option>
|
|
{% for value, label in categories %}
|
|
<option value="{{ value }}" {% if category == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="type_filter" class="form-label">Type</label>
|
|
<select name="type" id="type_filter" class="form-select">
|
|
<option value="">All Types</option>
|
|
{% for value, label in types %}
|
|
<option value="{{ value }}" {% if type_filter == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="status" class="form-label">Status</label>
|
|
<select name="status" id="status" class="form-select">
|
|
<option value="">All</option>
|
|
<option value="active" {% if status == 'active' %}selected{% endif %}>Active</option>
|
|
<option value="inactive" {% if status == 'inactive' %}selected{% endif %}>Inactive</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="search" class="form-label">Search</label>
|
|
<input type="text" name="search" id="search" class="form-control"
|
|
value="{{ search }}" placeholder="Search indicators...">
|
|
</div>
|
|
<div class="col-md-1">
|
|
<label class="form-label"> </label>
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
<i class="fas fa-search"></i>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Indicators List -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="card-title mb-0">
|
|
<i class="fas fa-list me-2"></i>Quality Indicators
|
|
<span class="badge bg-primary ms-2">{{ page_obj.paginator.count }}</span>
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if page_obj %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>Indicator</th>
|
|
<th>Category</th>
|
|
<th>Type</th>
|
|
<th>Target</th>
|
|
<th>Current Value</th>
|
|
<th>Status</th>
|
|
<th>Responsible</th>
|
|
<th>Last Updated</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for indicator in page_obj %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ indicator.name }}</strong><br>
|
|
<small class="text-muted">{{ indicator.description|truncatechars:50 }}</small>
|
|
</td>
|
|
<td>
|
|
<span class="badge bg-info">{{ indicator.get_category_display }}</span>
|
|
</td>
|
|
<td>
|
|
<span class="badge bg-secondary">{{ indicator.get_type_display }}</span>
|
|
</td>
|
|
<td>
|
|
{% if indicator.target_value %}
|
|
{{ indicator.target_value }}
|
|
{% if indicator.unit == 'PERCENTAGE' %}%{% elif indicator.unit == 'CURRENCY' %}${% endif %}
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if indicator.current_value %}
|
|
<strong class="text-{% if indicator.current_value >= indicator.target_value %}success{% else %}warning{% endif %}">
|
|
{{ indicator.current_value }}
|
|
{% if indicator.unit == 'PERCENTAGE' %}%{% elif indicator.unit == 'CURRENCY' %}${% endif %}
|
|
</strong>
|
|
{% else %}
|
|
<span class="text-muted">No data</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if indicator.is_active %}
|
|
<span class="badge bg-success">Active</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">Inactive</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if indicator.responsible_user %}
|
|
<strong>{{ indicator.responsible_user.get_full_name }}</strong><br>
|
|
<small class="text-muted">{{ indicator.responsible_department.name }}</small>
|
|
{% elif indicator.responsible_department %}
|
|
<span class="text-muted">{{ indicator.responsible_department.name }}</span>
|
|
{% else %}
|
|
<span class="text-muted">Unassigned</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if indicator.last_measurement_date %}
|
|
{{ indicator.last_measurement_date|date:"M d, Y" }}
|
|
{% else %}
|
|
<span class="text-muted">Never</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<div class="btn-group btn-group-sm" role="group">
|
|
<button type="button" class="btn btn-outline-primary" title="View Details">
|
|
<i class="fas fa-eye"></i>
|
|
</button>
|
|
<button type="button" class="btn btn-outline-success" title="Add Measurement">
|
|
<i class="fas fa-plus"></i>
|
|
</button>
|
|
<button type="button" class="btn btn-outline-secondary" title="Edit">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
{% if page_obj.has_other_pages %}
|
|
<nav aria-label="Indicators pagination">
|
|
<ul class="pagination justify-content-center">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page=1{% if search %}&search={{ search }}{% endif %}{% if category %}&category={{ category }}{% endif %}{% if type_filter %}&type={{ type_filter }}{% endif %}{% if status %}&status={{ status }}{% endif %}">First</a>
|
|
</li>
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.previous_page_number }}{% if search %}&search={{ search }}{% endif %}{% if category %}&category={{ category }}{% endif %}{% if type_filter %}&type={{ type_filter }}{% endif %}{% if status %}&status={{ status }}{% endif %}">Previous</a>
|
|
</li>
|
|
{% endif %}
|
|
|
|
<li class="page-item active">
|
|
<span class="page-link">
|
|
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
|
|
</span>
|
|
</li>
|
|
|
|
{% if page_obj.has_next %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.next_page_number }}{% if search %}&search={{ search }}{% endif %}{% if category %}&category={{ category }}{% endif %}{% if type_filter %}&type={{ type_filter }}{% endif %}{% if status %}&status={{ status }}{% endif %}">Next</a>
|
|
</li>
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.paginator.num_pages }}{% if search %}&search={{ search }}{% endif %}{% if category %}&category={{ category }}{% endif %}{% if type_filter %}&type={{ type_filter }}{% endif %}{% if status %}&status={{ status }}{% endif %}">Last</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
{% else %}
|
|
<div class="text-center py-5">
|
|
<i class="fas fa-chart-line fa-3x text-muted mb-3"></i>
|
|
<h5 class="text-muted">No Quality Indicators Found</h5>
|
|
<p class="text-muted">No quality indicators match your current filters.</p>
|
|
<a href="{% url 'quality:indicator_list' %}" class="btn btn-outline-primary">
|
|
Clear Filters
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|