mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 04:25:42 +00:00
BuildAttachmentDelete form
This commit is contained in:
@ -70,6 +70,15 @@ $("#attachment-table").on('click', '.attachment-edit-button', function() {
|
||||
$("#attachment-table").on('click', '.attachment-delete-button', function() {
|
||||
var pk = $(this).attr('pk');
|
||||
|
||||
constructForm(`/api/build/attachment/${pk}/`, {
|
||||
method: 'DELETE',
|
||||
confirmMessage: '{% trans "Confirm Delete Operation" %}',
|
||||
title: '{% trans "Delete Attachment" %}',
|
||||
reload: true,
|
||||
});
|
||||
|
||||
return;
|
||||
|
||||
var url = `/build/attachment/${pk}/delete/`;
|
||||
|
||||
launchModalForm(
|
||||
|
@ -36,10 +36,6 @@ build_urls = [
|
||||
url('^new/', views.BuildItemCreate.as_view(), name='build-item-create'),
|
||||
])),
|
||||
|
||||
url('^attachment/', include([
|
||||
url(r'^(?P<pk>\d+)/delete/', views.BuildAttachmentDelete.as_view(), name='build-attachment-delete'),
|
||||
])),
|
||||
|
||||
url(r'new/', views.BuildCreate.as_view(), name='build-create'),
|
||||
|
||||
url(r'^(?P<pk>\d+)/', include(build_detail_urls)),
|
||||
|
@ -1058,18 +1058,3 @@ class BuildItemEdit(AjaxUpdateView):
|
||||
form.fields['install_into'].widget = HiddenInput()
|
||||
|
||||
return form
|
||||
|
||||
|
||||
class BuildAttachmentDelete(AjaxDeleteView):
|
||||
"""
|
||||
View for deleting a BuildAttachment
|
||||
"""
|
||||
|
||||
model = BuildOrderAttachment
|
||||
ajax_form_title = _('Delete Attachment')
|
||||
context_object_name = 'attachment'
|
||||
|
||||
def get_data(self):
|
||||
return {
|
||||
'danger': _('Deleted attachment')
|
||||
}
|
||||
|
Reference in New Issue
Block a user