{% load i18n %}

<div class="card card-primary mb-3">
    <div class="card-header">
        <div class="card-title mb-0">
            {% translate "Fitting Information" %}

            {% if perms.fittings.manage %}
                <button
                    type="button"
                    class="btn btn-sm btn-danger float-end ms-1"
                    data-bs-toggle="modal"
                    data-bs-target="#deleteModal"
                    data-bs-tooltip="aa-fittings"
                    title="{% translate 'Delete Fit' %}"
                >
                    <span class="fa-solid fa-times"></span>
                </button>

                <a
                    href="{% url 'fittings:edit_fit' fit.pk %}"
                    class="btn btn-sm btn-warning float-end"
                    data-bs-tooltip="aa-fittings"
                    title="{% translate 'Edit/Update Fit' %}"
                >
                    <span class="fa-solid fa-pencil-alt"></span>
                </a>
            {% endif %}
        </div>
    </div>

    <div class="card-body">
        <dl>
            <dt>{% translate "Doctrines" %} </dt>
            <dd>
                <ul>
                    {% for doctrine in doctrines %}
                        <li>
                            <a href="{% url 'fittings:view_doctrine' doctrine.pk %}">
                                {{ doctrine.name }}
                            </a>
                        </li>
                    {% endfor %}
                </ul>
            </dd>
        </dl>

        {% if fit.created %}
            <dt>{% translate "Created" %}</dt>
            {% if LANGUAGE_CODE == 'ko' or LANGUAGE_CODE == 'ja' %}
                <dd>{{ fit.created|date:'Y-m-d / H:i:s' }}</dd>
            {% else %}
                <dd>{{ fit.created|date:'d M Y H:i:s' }}</dd>
            {% endif %}
        {% endif %}

        {% if fit.last_updated %}
            <dt>{% translate "Last Updated" %}</dt>
            {% if LANGUAGE_CODE == 'ko' or LANGUAGE_CODE == 'ja' %}
                <dd>{{ fit.last_updated|date:'Y-m-d / H:i:s' }}</dd>
            {% else %}
                <dd>{{ fit.last_updated|date:'d M Y H:i:s' }}</dd>
            {% endif %}
        {% endif %}
    </div>
</div>
