Add view / template to delete a build

This commit is contained in:
Oliver Walters 2019-08-15 19:34:55 +10:00
parent d9e5bfd971
commit 03b7e3a815
3 changed files with 17 additions and 3 deletions

View File

@ -0,0 +1,5 @@
{% extends "modal_delete_form.html" %}
{% block pre_form_content %}
Are you sure you want to delete this build?
{% endblock %}

View File

@ -17,9 +17,10 @@ build_item_urls = [
]
build_detail_urls = [
url(r'^edit/?', views.BuildUpdate.as_view(), name='build-edit'),
url(r'^allocate/?', views.BuildAllocate.as_view(), name='build-allocate'),
url(r'^cancel/?', views.BuildCancel.as_view(), name='build-cancel'),
url(r'^edit/', views.BuildUpdate.as_view(), name='build-edit'),
url(r'^allocate/', views.BuildAllocate.as_view(), name='build-allocate'),
url(r'^cancel/', views.BuildCancel.as_view(), name='build-cancel'),
url(r'^delete/', views.BuildDelete.as_view(), name='build-delete'),
url(r'^complete/?', views.BuildComplete.as_view(), name='build-complete'),
url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'),
url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'),

View File

@ -397,6 +397,14 @@ class BuildUpdate(AjaxUpdateView):
}
class BuildDelete(AjaxDeleteView):
""" View to delete a build """
model = Build
ajax_template_name = 'build/delete_build.html'
ajax_form_title = 'Delete Build'
class BuildItemDelete(AjaxDeleteView):
""" View to 'unallocate' a BuildItem.
Really we are deleting the BuildItem object from the database.