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

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

{% block page_title %}{% translate "Add 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>

            {% if msg.0 != 'warning' %}
                <h4>
                    {% if msg.0 == 'danger' %}
                        {% translate "Oh No!" %}
                    {% elif msg.0 == 'success' %}
                        {% translate "Success!" %}
                    {% endif %}
                </h4>
            {% endif %}

            <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 "Add 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="form-label">
                            {% translate "Description" %}
                        </label>

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

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

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

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