{% extends "base.html" %}
{% load i18n %}

{% block title %}{{ _("View Customer") }}{% endblock title %}

{% block content %}
    <!-- Delete Modal -->
    <div class="modal fade" id="deleteModal"
         data-bs-backdrop="static"
         data-bs-keyboard="false"
         tabindex="-1"
         aria-labelledby="deleteModalLabel"
         aria-hidden="true">
        <div class="modal-dialog modal-sm ">
            <div class="modal-content rounded">
                <div class="modal-body d-flex justify-content-center">
                    <h1 class="text-danger me-2"><i class="bi bi-exclamation-diamond-fill"></i></h1>
                    <span class="text-danger">
                        {% trans "Are you sure you want to delete this customer?" %}
                    </span>
                </div>
                <div class="btn-group">
                    <button type="button"
                            class="btn btn-sm btn-secondary"
                            data-bs-dismiss="modal">
                        {% trans 'No' %}
                    </button>
                    <a type="button"
                       class="btn btn-sm btn-danger"
                       href="{% url 'customer_delete' customer.id %}">
                        {% trans 'Yes' %}
                    </a>
                </div>
            </div>
        </div>
    </div>

<div class="container my-5">
    <div class="card rounded ">
        <div class="card-header bg-primary text-white ">
            <p class="mb-0">{{ _("Customer Details") }}</p>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-6">
                    <p><strong>{{ _("First Name") }}:</strong> {{ customer.first_name }}</p>
                    <p><strong>{{ _("Middle Name") }}:</strong> {{ customer.middle_name }}</p>
                    <p><strong>{{ _("Last Name") }}:</strong> {{ customer.last_name }}</p>
                </div>
                <div class="col-md-6">
                    <p><strong>{{ _("Email") }}:</strong> {{ customer.email }}</p>
                    <p><strong>{{ _("National ID") }}:</strong> {{ customer.national_id }}</p>
                    <p><strong>{{ _("Phone Number") }}:</strong> {{ customer.phone_number }}</p>
                    <p><strong>{{ _("Address") }}:</strong> {{ customer.address }}</p>
                </div>
            </div>
        </div>
        <div class="card-footer d-flex ">
            <a class="btn btn-sm btn-primary me-1" href="{% url 'customer_update' customer.id %}">
                <!--<i class="bi bi-pencil-square"></i> -->
                {{ _("Edit") }}
            </a>
            <a class="btn btn-sm btn-danger me-1"
               data-bs-toggle="modal"
               data-bs-target="#deleteModal">
                <!--<i class="bi bi-trash-fill"></i>-->
                {{ _("Delete") }}
            </a>
            <a class="btn btn-sm btn-secondary"
               href="{% url 'customer_list' %}">
                <!--<i class="bi bi-arrow-left-square-fill"></i>-->
                {% trans "Back to List" %}
            </a>
        </div>
    </div>
</div>
{% endblock %}
