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 }}'? Are you sure you want to delete company '{{ company.name }}'?
<br> <br>
@ -11,3 +15,5 @@ If this supplier is deleted, these supplier part entries will also be deleted.</
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% endblock %}

View File

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

View File

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