88 lines
4.5 KiB
HTML
88 lines
4.5 KiB
HTML
<!-- templates/recalls/recall_list.html -->
|
|
{% extends "base.html" %}
|
|
{% load i18n humanize %}
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<div class="d-flex justify-content-between mb-3">
|
|
<h2>{% trans "Recall History" %}</h2>
|
|
<a href="{% url 'recall_filter' %}" class="btn btn-primary">{% trans "Create Recall" %}</a>
|
|
</div>
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover">
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th>{% trans "Title" %}</th>
|
|
<th>{% trans "Sent At" %}</th>
|
|
<th>{% trans "Make" %}</th>
|
|
<th>{% trans "Model" %}</th>
|
|
<th>{% trans "Series" %}</th>
|
|
<th>{% trans "Affected Dealers" %}</th>
|
|
<th>{% trans "Affected Cars" %}</th>
|
|
<th>{% trans "Actions" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for recall in recalls %}
|
|
<tr>
|
|
<td>{{ recall.title }}</td>
|
|
<td>
|
|
<span title="{{ recall.created_at }}">{{ recall.created_at|date }}</span>
|
|
</td>
|
|
<td>
|
|
<img src="{{ recall.make.logo.url }}" width="50" height="50">
|
|
{{ recall.make|default:"-" }}
|
|
</td>
|
|
<td>{{ recall.model|default:"-" }}</td>
|
|
<td>{{ recall.serie|default:"-" }}</td>
|
|
<td>{{ recall.dealer_count }}</td>
|
|
<td>{{ recall.car_count }}</td>
|
|
<td>
|
|
<a href="{% url 'recall_detail' recall.id %}"
|
|
class="btn btn-sm btn-info"
|
|
title="{% trans 'View details' %}">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="8" class="text-center">{% trans "No recalls found" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if is_paginated %}
|
|
<nav aria-label="Page navigation">
|
|
<ul class="pagination justify-content-center mt-4">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">{% trans "Previous" %}</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>
|
|
{% else %}
|
|
<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 }}">{% trans "Next" %}</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|