Re-added missing "New Part" button

This commit is contained in:
Oliver 2018-05-06 19:21:33 +10:00
parent 01da57f0cf
commit 19ce05931c

View File

@ -43,6 +43,10 @@
<table class='table table-striped table-condensed' id='part-table'> <table class='table table-striped table-condensed' id='part-table'>
</table> </table>
<div>
<button style='float: right;' class='btn btn-success' id='part-create'>New Part</button>
</div>
{% endblock %} {% endblock %}
{% block js_ready %} {% block js_ready %}
@ -61,6 +65,19 @@
}); });
}) })
$("#part-create").click(function() {
launchModalForm("#modal-form",
"{% url 'part-create' %}",
{
follow: true,
data: {
{% if category %}
category: {{ category.id }}
{% endif %}
}
});
});
{% if category %} {% if category %}
$("#cat-edit").click(function () { $("#cat-edit").click(function () {
launchModalForm("#modal-form", launchModalForm("#modal-form",