{% extends "base.html" %} {% load static %} {% block content %} {% include "part/cat_link.html" with category=category %}

{{ category.name }}
{{ category.description }}

{% if category.has_children %}

Subcategories

{% include "part/category_subcategories.html" with children=category.children.all %} {% endif %} {% if category.has_parts %}

Parts

{% include "part/category_parts.html" with parts=category.parts.all %} {% endif %}
{% include 'modals.html' %} {% endblock %} {% block js_load %} `` {% endblock %} {% block js_ready %} $('#part-list').footable(); $("#edit-category").click(function () { launchModalForm("#modal-form", "{% url 'category-edit' category.id %}", {reload: true}, ); }); {% if category.parent %} var categoryRedirect = "{% url 'category-detail' category.parent.id %}"; {% else %} var categoryRedirect = "{% url 'part-index' %}"; {% endif %} $("#delete-category").click(function() { launchDeleteForm("#modal-delete", "{% url 'category-delete' category.id %}", { redirect: categoryRedirect }); }); $("#create-cat").click(function() { launchModalForm("#modal-form", "{% url 'category-create' %}", { follow: true, data: { category: {{ category.id }} } }); }); $("#create-part").click( function() { launchModalForm("#modal-form", "{% url 'part-create' %}", { data: { category: {{ category.id }} }, follow: true }); }); {% endblock %}