agdar/templates/documents/template_list.html
Marwan Alwali a788c086ae update
2025-11-02 18:05:50 +03:00

81 lines
3.3 KiB
HTML

{% extends "base.html" %}
{% load i18n static %}
{% block title %}{% trans "Document Templates" %} - {{ block.super }}{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3 mb-0">
<i class="fa fa-file-alt me-2"></i>{% trans "Document Templates" %}
</h1>
<a href="{% url 'documents:template-create' %}" class="btn btn-primary">
<i class="fa fa-plus me-1"></i>{% trans "New Template" %}
</a>
</div>
<div class="card">
<div class="card-body">
{% if templates %}
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Category" %}</th>
<th>{% trans "Active" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for template in templates %}
<tr>
<td>
<a href="{% url 'documents:template-detail' template.pk %}">
{{ template.name }}
</a>
</td>
<td><span class="badge bg-info">{{ template.get_category_display }}</span></td>
<td>
{% if template.is_active %}
<span class="badge bg-success">{% trans "Active" %}</span>
{% else %}
<span class="badge bg-secondary">{% trans "Inactive" %}</span>
{% endif %}
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{% url 'documents:template-detail' template.pk %}" class="btn btn-outline-primary">
<i class="fa fa-eye"></i>
</a>
<a href="{% url 'documents:template-update' template.pk %}" class="btn btn-outline-warning">
<i class="fa fa-edit"></i>
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
{% include "includes/pagination_unified.html" %}
{% endif %}
</div>
{% else %}
<div class="text-center py-5">
<i class="fa fa-file-alt fa-3x text-muted mb-3"></i>
<p class="text-muted">{% trans "No templates found." %}</p>
<a href="{% url 'documents:template-create' %}" class="btn btn-primary">
<i class="fa fa-plus me-1"></i>{% trans "Create First Template" %}
</a>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}