mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Delete a part parameter template from the settings view
This commit is contained in:
parent
42ade0e0b7
commit
c45fcb45cf
@ -22,7 +22,7 @@ part_parameter_urls = [
|
|||||||
|
|
||||||
url('^template/new/', views.PartParameterTemplateCreate.as_view(), name='part-param-template-create'),
|
url('^template/new/', views.PartParameterTemplateCreate.as_view(), name='part-param-template-create'),
|
||||||
url('^template/(?P<pk>\d+)/edit/', views.PartParameterTemplateEdit.as_view(), name='part-param-template-edit'),
|
url('^template/(?P<pk>\d+)/edit/', views.PartParameterTemplateEdit.as_view(), name='part-param-template-edit'),
|
||||||
#url('^template/(?P<pk>\d+)/delete/', views.PartParameterTemplateDelete.as_view(), name='part-param-template-edit'),
|
url('^template/(?P<pk>\d+)/delete/', views.PartParameterTemplateDelete.as_view(), name='part-param-template-edit'),
|
||||||
|
|
||||||
url('^new/', views.PartParameterCreate.as_view(), name='part-param-create'),
|
url('^new/', views.PartParameterCreate.as_view(), name='part-param-create'),
|
||||||
url('^(?P<pk>\d+)/edit/', views.PartParameterEdit.as_view(), name='part-param-edit'),
|
url('^(?P<pk>\d+)/edit/', views.PartParameterEdit.as_view(), name='part-param-edit'),
|
||||||
|
@ -1454,6 +1454,13 @@ class PartParameterTemplateEdit(AjaxUpdateView):
|
|||||||
ajax_form_title = 'Edit Part Parameter Template'
|
ajax_form_title = 'Edit Part Parameter Template'
|
||||||
|
|
||||||
|
|
||||||
|
class PartParameterTemplateDelete(AjaxDeleteView):
|
||||||
|
""" View for deleting an existing PartParameterTemplate """
|
||||||
|
|
||||||
|
model = PartParameterTemplate
|
||||||
|
ajax_form_title = "Delete Part Parameter Template"
|
||||||
|
|
||||||
|
|
||||||
class PartParameterCreate(AjaxCreateView):
|
class PartParameterCreate(AjaxCreateView):
|
||||||
""" View for creating a new PartParameter """
|
""" View for creating a new PartParameter """
|
||||||
|
|
||||||
|
@ -76,4 +76,16 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#param-table").on('click', '.template-delete', function() {
|
||||||
|
var button = $(this);
|
||||||
|
|
||||||
|
var url = "/part/parameter/template/" + button.attr('pk') + "/delete/";
|
||||||
|
|
||||||
|
launchModalForm(url, {
|
||||||
|
success: function() {
|
||||||
|
$("#param-table").bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user