{% load i18n %}

<h2>{% trans 'Categories' %}</h2>
{% if categories %}
    <form action="{% url lfs_manage_product_categories product.id %}"
          method="post">
        <ul class="manage-categories root">
            {% for category in categories %}
                <li>
                    <input type="checkbox"
                           name="categories"
                           value="{{ category.id }}"
                           {% if category.checked %}checked="checked"{% endif %} />
                    <a href="{% url lfs_manage_category category.id %}">
                        {{ category.name }}
                    </a>
                    {{ category.children }}
                </li>
            {% endfor %}
        </ul>
        <div class="buttons">
            <input class="ajax-save-button button"
                   type="submit" value="{% trans 'Save categories' %}" />
        </div>
    </form>
{% else %}
    <p>{% trans 'There are no categories' %}</p>
{% endif %}