{% extends "admin/change_list.html" %}
{% load i18n %}

{% block result_list %}
    {{ block.super }}
    {% if summary_metrics %}
    <div class="card" style="margin-top: 15px; border: 1px solid #dee2e6;">
        <div class="card-header bg-info text-white">
            <h5 class="card-title m-0">
                <i class="fas fa-calculator mr-2"></i> {% trans "Totals (Current Page/Filter)" %}
            </h5>
        </div>
        <div class="card-body p-0">
            <table class="table table-striped table-bordered m-0">
                <thead>
                    <tr>
                        <th class="text-center">{% trans "Total Price" %}</th>
                        <th class="text-center">{% trans "Total Driver Amount" %}</th>
                        <th class="text-center">{% trans "Total Platform Fee" %}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-center text-bold">{{ summary_metrics.total_price|default:0|stringformat:".3f" }} OMR</td>
                        <td class="text-center text-bold">{{ summary_metrics.total_driver_amount|default:0|stringformat:".3f" }} OMR</td>
                        <td class="text-center text-bold">{{ summary_metrics.total_platform_fee|default:0|stringformat:".3f" }} OMR</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    {% endif %}
{% endblock %}