{% load i18n %}
{% load lfs_manage_tags %}

<h2 class="heading-first">{% trans 'Accessories' %}</h2>

{% if product.is_variant %}
    <form action="{% url lfs_manage_update_accessories product.id %}"
          method="post">
        {% csrf_token %}
        <input type="checkbox"
               name="active_accessories"
               {% if product.active_accessories %}checked="checked"{% endif %} />
        <label for="active_accessories">
            {% trans 'Active accessories' %}
        </label>
        <input class="ajax-save-button button" 
               type="submit" 
               value='{% trans "Update" %}' />
    </form>
    <div class="separator"></div>
    
{% endif %}

<form id="filter-accessories-form"
      action="{% url lfs.manage.views.manage_accessories_inline product.id %}"
      onsubmit="return false">
    <input class="refresh-on-keyup" type="text" name="filter"/>

    {% category_filter "refresh-on-change" "accessories_category_filter" %}

    <select class="refresh-on-change"
            name="accessories-amount">
        {% for option in amount_options %}
            <option {% if option.selected %}selected="selected"{% endif %}
                    value="{{ option.value }}">{{ option.value }}</option>
        {% endfor %}
    </select>
</form>

{{ accessories_inline }}
