{% extends 'oscar/dashboard/layout.html' %}
{% load i18n %}
{% load currency_filters %}

{% block title %}
    {% if method %}
        {{ method.name }}
    {% else %}
        {% trans "Create a new shipping method" %}
    {% endif %}
    | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a></li>
            <li class="breadcrumb-item"><a href="{% url 'dashboard:shipping-method-list' %}">{% trans "Shipping methods" %}</a></li>
            {% if method %}
                <li class="breadcrumb-item">{{ method.name }}</li>
                <li class="breadcrumb-item active" aria-current="page">{% trans "Edit" %}</li>
            {% else %}
                <li class="breadcrumb-item active" aria-current="page">{% trans "Create a new shipping method" %}</li>
            {%  endif %}
        </ol>
    </nav>
{% endblock %}

{% block headertext %}
    {% if method %}
        {{ method.name }}
    {% else %}
        {% trans "Create a new shipping method" %}
    {% endif %}
{% endblock %}

{% block dashboard_content %}
    <form id="create_update_weight_based_form" method="post" class="form-stacked card card-body bg-light wysiwyg">
        {% csrf_token %}
        {% include "oscar/dashboard/partials/form_fields.html" with form=form %}
        {% block form_actions %}
            <div class="form-actions">
                <button class="btn btn-primary" type="submit" data-loading-text="{% trans 'Saving...' %}">{% trans "Save" %}</button> {% trans "or" %}
                <a href="{% url 'dashboard:shipping-method-list' %}">{% trans "cancel" %}</a>
            </div>
        {% endblock form_actions %}
    </form>
{% endblock %}
