{% extends 'dashboard.html' %}

{% block head_title %}Update {{ variant }} | {% endblock %}

{% block content %}
<article>
    <p>
        <a href="{% url 'dashboard:product-detail' product.pk %}">&larr; Back to product</a>
    </p>
    <header class="object-header">
        <h1>Update variant</h1>
        {% if perms.core.delete_productvariant %}
        <a href="{% url 'dashboard:variant-delete' product.pk variant.pk %}" class="btn btn-warning">Delete</a>
        {% endif %}
    </header>
    <section class="panel">
        <form method="POST" action="{% url 'dashboard:variant-update' product.pk variant.pk %}" class="panel-form">
            {% csrf_token %}
            {{form.as_p}}
            <p>
                <button type="submit">Save changes</button>
            </p>
        </form>
    </section>
</article>
{% endblock %}
