2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

More modal forms

- supplier-part-edit
- supplier-part-delete
This commit is contained in:
Oliver
2018-04-27 21:32:48 +10:00
parent bc3dca3aba
commit e1e3cc71e6
6 changed files with 80 additions and 33 deletions

View File

@ -1,5 +1 @@
{% extends 'delete_obj.html' %}
{% block del_title %}
Are you sure you want to delete this supplier part?
{% endblock %}
Are you sure you want to delete this supplier part?

View File

@ -1,5 +1,5 @@
{% extends "base.html" %}
{% load static %}
{% block content %}
<h3>Supplier part information</h3>
@ -30,13 +30,40 @@
<br>
<div class='container-fluid'>
<a href="{% url 'supplier-part-edit' part.id %}">
<button class="btn btn-info">Edit supplier part</button>
</a>
<a href="{% url 'supplier-part-delete' part.id %}">
<button class="btn btn-danger">Delete supplier part</button>
</a>
<button class="btn btn-info" id='part-edit'>Edit supplier part</button>
<button class="btn btn-danger" id='part-delete'>Delete supplier part</button>
</div>
{% include 'modal.html' %}
{% include 'modal_delete.html' %}
{% endblock %}
{% block javascript %}
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
<script type='text/javascript'>
$(document).ready(function () {
$('#part-edit').click(function () {
launchModalForm("#modal-form",
"{% url 'supplier-part-edit' part.id %}",
{
reload: true
}
);
});
$('#part-delete').click(function() {
launchDeleteForm("#modal-delete",
"{% url 'supplier-part-delete' part.id %}",
{
redirect: "{% url 'company-index' %}"
}
);
});
});
</script>
{% endblock %}