97 lines
3.9 KiB
HTML
97 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n static %}
|
|
|
|
{% block title %}{{ _("Quotations") }}{% endblock title %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<h3 class="text-center">{% trans "Quotations" %}</h3>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped align-middle">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>{% trans "Quotation Number" %}</th>
|
|
<th>{% trans "Customer" %}</th>
|
|
<th>{% trans "Total Cars" %}</th>
|
|
<th>{% trans "Total Amount" %}</th>
|
|
<th>{% trans "Created At" %}</th>
|
|
<th>{% trans "Actions" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for quotation in quotations %}
|
|
<tr>
|
|
<td>{{ forloop.counter }}</td>
|
|
<td>{{ quotation.quotation_number }}</td>
|
|
<td>{{ quotation.customer.get_full_name }}</td>
|
|
<td>{{ quotation.quotation_cars.count }}</td>
|
|
<td>{{ quotation.total_vat }}</td>
|
|
<td>
|
|
{% if quotation.status == 'Draft' %}
|
|
<span class="badge rounded-pill bg-secondary">{{quotation.status|capfirst}}</span>
|
|
{% elif quotation.status == 'In Review' %}
|
|
<span class="badge rounded-pill bg-warning">{{quotation.status|capfirst}}</span>
|
|
{% elif quotation.status == 'Approved' %}
|
|
<span class="badge rounded-pill bg-info">{{quotation.status|capfirst}}</span>
|
|
{% elif quotation.status == 'Paid' %}
|
|
<span class="badge rounded-pill bg-success">{{quotation.status|capfirst}}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ quotation.created_at|date:"d/m/Y H:i" }}</td>
|
|
<td>
|
|
<a href="{% url 'quotation_detail' quotation.id %}" class="btn btn-sm btn-info">
|
|
{% trans "view" %}
|
|
</a>
|
|
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="6" class="text-center">{% trans "No Quotations Found" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if is_paginated %}
|
|
<nav aria-label="Page navigation">
|
|
<ul class="pagination mb-0">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item py-0">
|
|
<a class="page-link" href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
|
|
<span aria-hidden="true"><span class="fas fa-chevron-left"></span></span>
|
|
</a>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled">
|
|
<a class="page-link" href="#" aria-label="Previous">
|
|
<span aria-hidden="true"><span class="fas fa-chevron-left"></span></span>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% for num in page_obj.paginator.page_range %}
|
|
{% if page_obj.number == num %}
|
|
<li class="page-item active"><a class="page-link" href="?page={{ num }}">{{ num }}</a></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 }}" aria-label="Next">
|
|
<span aria-hidden="true"><span class="fas fa-chevron-right"></span></span>
|
|
</a>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled">
|
|
<a class="page-link" href="#" aria-label="Next">
|
|
<span aria-hidden="true"><span class="fas fa-chevron-right"></span></span>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %} |