{% extends "base.html" %} {% load static %} {% block css %} {% endblock %} {% block content %} {% include "part/cat_link.html" with category=category %} {% include 'modals.html' %} {% if children.all|length > 0 %}

Part Categories

{% include "part/category_subcategories.html" with children=children %} {% endif %}

Parts

{% include "part/category_parts.html" with parts=parts %}
{% endblock %} {% block js_load %} {% endblock %} {% block js_ready %} $('#part-list').footable(); $("#create-cat").click(function() { launchModalForm("#modal-form", "{% url 'category-create' %}", { follow: true }); }); function loadTree() { var requestData = {}; {% if category %} requestData.category = {{ category.id }}; {% endif %} $.ajax({ url: "{% url 'api-part-tree' %}", type: 'get', dataType: 'json', data: requestData, success: function (response) { if (response.tree) { $("#part-tree").treeview({ data: response.tree, enableLinks: true }); } }, error: function (xhr, ajaxOptions, thrownError) { alert('Error retrieving part tree:\n' + thrownError); } }); } $("#create-part").click(function() { launchModalForm("#modal-form", "{% url 'part-create' %}"); }); loadTree(); {% endblock %}