{% extends 'fittings/base.html' %}

{% load i18n %}
{% load humanize %}
{% load filters %}

{% block page_title %}{% translate "Update Fitting" %}{% endblock %}

{% block fittings_block %}
    {% if msg %}
        <div class="alert alert-{{ msg.0 }} alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="close">
                <span aria-hidden="true">&times</span>
            </button>
            <h4>
                {% if msg.0 == 'danger' %}
                    {% translate "Oh No!" %}
                {% elif msg.0 == 'success' %}
                    {% translate "Success!" %}
                {% endif %}
            </h4>
            <p>{{ msg.1 }}</p>
        </div>
    {% endif %}

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

            <div class="card-body">
                <form class="form-signin" role="form" action="" method="POST">
                    {% csrf_token %}

                    <div class="form-group mb-3">
                        <label for="description" class="col-sm-2 form-label">{% translate "Description" %}</label>

                        <textarea class="form-control" name="description" id="description" maxlength="500" rows="3">{{ fit.description }}</textarea>
                    </div>

                    <br>
                    <div class="form-group mb-3">
                        <label for="eft" class="col-sm-2 form-label">{% translate "Fitting" %}</label>

                        <textarea class="form-control" name="eft" id="eft" rows="25">{{ fit.eft }}</textarea>
                    </div>

                    <button class="btn btn-primary btn-block" type="submit">{% translate "Submit" %}</button>
                </form>
            </div>
        </div>
    </div>
{% endblock %}
