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

{% block head_title %}{{ option }} | {% endblock %}

{% block content %}
<article>
    <p>
        <a href="{% url 'dashboard:catalog' %}">&larr; Back to catalog</a>
    </p>
    <header class="object-header">
        <h1>Product Option: {{ option.name }}</h1>
        <div class="object-menu">
            {% if perms.core.delete_productoption %}
            <a href="{% url 'dashboard:option-delete' option.pk %}" class="btn btn-warning">Delete</a>
            {% endif %}
            {% if perms.core.change_productoption %}
            <a href="{% url 'dashboard:option-update' option.pk %}" class="btn">Edit</a>
            {% endif %}
        </div>
    </header>
    <section class="panel">
        <header class="panel-header">
            <h4>Products</h4>
        </header>
        <ul>
        {% for product in option.products.all %}
            <li><a href="{% url 'dashboard:product-detail' product.pk %}">{{ product.name }}</a></li>
        {% endfor %}
        </ul>
    </section>
</article>
{% endblock content %}
