Update delete form for Company objects

This commit is contained in:
Oliver Walters 2019-05-13 22:50:05 +10:00
parent a78106526a
commit 0e0096467c
3 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
{% extends "modal_delete_form.html" %}
{% block pre_form_content %}
Are you sure you want to delete company '{{ company.name }}'?
<br>
@ -11,3 +15,5 @@ If this supplier is deleted, these supplier part entries will also be deleted.</
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@ -54,7 +54,7 @@
});
$('#delete-company').click(function() {
launchDeleteForm(
launchModalForm(
"{% url 'company-delete' company.id %}",
{
redirect: "{% url 'company-index' %}"

View File

@ -93,10 +93,12 @@ class CompanyCreate(AjaxCreateView):
class CompanyDelete(AjaxDeleteView):
""" View for deleting a Company object """
model = Company
success_url = '/company/'
ajax_template_name = 'company/delete.html'
ajax_form_title = 'Delete Company'
context_object_name = 'company'
def get_data(self):
return {