{% extends 'dashboard.html' %}
{% load static %}

{% block head_title %}{{ rate }} | {% endblock %}

{% block content %}
<article>
    <p>
        <a href="{% url 'dashboard:config' %}">&larr; Back to site configuration</a>
    </p>
    <header class="object-header">
        <h1><img src="{% static 'images/gear.png' %}"> Shipping Rate</h1>
        <div class="object-menu">
            {% if perms.core.delete_shippingrate %}
            <a href="{% url 'dashboard:rate-delete' rate.pk %}" class="btn btn-warning">Delete</a>
            {% endif %}
            {% if perms.core.change_shippingrate %}
            <a href="{% url 'dashboard:rate-update' rate.pk %}" class="btn">Edit</a>
            {% endif %}
        </div>
    </header>
    <section class="panel">
        <header class="panel-header">
            <h4>{{rate.name}}</h4>
        </header>
        <dl class="panel-datalist">
            <dt>Shipping Provider</dt>
            <dd>{{ rate.shipping_provider }}</dd>
            <dt>Container</dt>
            <dd>{{ rate.get_container_display }}</dd>
            <dt>Weight range</dt>
            <dd>{{ rate.min_order_weight }} &ndash; {{ rate.max_order_weight }}</dd>
        </dl>
    </section>
</article>
{% endblock content %}
