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

{% block content %}
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow">
                <div class="card-body p-5">
                    <h2 class="mb-4">{% trans "Post a New Shipment" %}</h2>

                    {% if form.errors %}
                    <div class="alert alert-danger">
                        {% trans "Please correct the errors below." %}
                        {{ form.non_field_errors }}
                    </div>
                    {% endif %}

                    <form method="post">
                        {% csrf_token %}
                        <div class="mb-3">
                            <label class="form-label">{% trans "Goods Description" %}</label>
                            {{ form.description }}
                            {{ form.description.errors }}
                        </div>
                        <div class="mb-3">
                            <label class="form-label">{% trans "Weight/Volume" %}</label>
                            {{ form.weight }}
                            {{ form.weight.errors }}
                        </div>
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                <label class="form-label">{% trans "Origin" %}</label>
                                {{ form.origin }}
                                {{ form.origin.errors }}
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label">{% trans "Destination" %}</label>
                                {{ form.destination }}
                                {{ form.destination.errors }}
                            </div>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">{% trans "Requested Delivery Date" %}</label>
                            {{ form.delivery_date }}
                            {{ form.delivery_date.errors }}
                        </div>
                        <button type="submit" class="btn btn-primary w-100 py-3 mt-4">{% trans "Post Shipment" %}</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}