2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-18 08:15:21 +00:00
Oliver e3b2bd7129 Abstracted jquery code to load a modal form
- static/scripts/modal_form.js
- bindModalForm function takes care of the mechanics
2018-04-25 15:28:57 +10:00

45 lines
1018 B
HTML

{% extends "base.html" %}
{% load static %}
{% block content %}
{% include "part/cat_link.html" with category=category %}
<div class='modal fade' id='modal-cat'>
<div class='modal-dialog'>
<div class='modal-content'>
</div>
</div>
</div>
{% if children.all|length > 0 %}
<h4>Part Categories</h4>
{% include "part/category_subcategories.html" with children=children %}
{% endif %}
<h4>Parts</h4>
{% include "part/category_parts.html" with parts=parts %}
<div class='container-fluid'>
<button type='button' class='btn btn-primary js-create-cat'>
New Category
</button>
<a href="{% url 'part-create' %}">
<button class="btn btn-success">New Part</button>
</a>
</div>
{% endblock %}
{% block javascript %}
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
<script type="text/javascript">
$(document).ready(function () {
bindModalForm('#modal-cat', '.js-create-cat', "{% url 'category-create' %}", {category: 1});
});
</script>
{% endblock %}