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

{% block head_title %}{{ coupon }} | {% endblock %}

{% block content %}
<article>
    <p>
        <a href="{% url 'dashboard:coupon-list' %}">&larr; Back to coupons</a>
    </p>
    <header class="object-header">
        <h1><img src="{% static 'images/coupon.png' %}"> {{ coupon.name }}</h1>
        <div class="object-menu">
            {% if perms.core.delete_coupon %}
            <a href="{% url 'dashboard:coupon-delete' coupon.pk %}" class="btn btn-warning">Delete</a>
            {% endif %}
            {% if perms.core.change_coupon %}
            <a href="{% url 'dashboard:coupon-update' coupon.pk %}" class="btn">Edit</a>
            {% endif %}
        </div>
    </header>
    <section class="panel">
        <header class="panel-header">
            <h4>Details</h4>
        </header>
        <dl class="panel-datalist">
            <dt>Applies to</dt>
            <dd>{{ coupon.get_type_display }}</dd>
            <dt>Code</dt>
            <dd>{{ coupon.code }}</dd>
            <dt>Valid from</dt>
            <dd>{{ coupon.valid_from }}</dd>
            <dt>Valid to</dt>
            <dd>{{ coupon.valid_to }}</dd>
            <dt>Discount value</dt>
            <dd>{{ coupon.discount_value }} {{ coupon.get_discount_value_type_display }}</dd>
        </dl>
    </section>
</article>
{% endblock content %}
