mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add modals for editing or deleting part parameters
This commit is contained in:
parent
51e4bdd821
commit
586a46175d
5
InvenTree/part/templates/part/param_delete.html
Normal file
5
InvenTree/part/templates/part/param_delete.html
Normal file
@ -0,0 +1,5 @@
|
||||
{% extends "modal_delete_form.html" %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
Are you sure you want to remove this parameter?
|
||||
{% endblock %}
|
@ -29,8 +29,8 @@
|
||||
<td>
|
||||
{{ param.template.units }}
|
||||
<div class='btn-group' style='float: right;'>
|
||||
<button title='Edit' class='btn btn-default btn-glyph' type='button'><span class='glyphicon glyphicon-edit'/></button>
|
||||
<button title='Delete' class='btn btn-default btn-glyph' type='button'><span class='glyphicon glyphicon-trash'/></button>
|
||||
<button title='Edit' class='btn btn-default btn-glyph param-edit' url="{% url 'part-param-edit' param.id %}" type='button'><span class='glyphicon glyphicon-edit'/></button>
|
||||
<button title='Delete' class='btn btn-default btn-glyph param-delete' url="{% url 'part-param-delete' param.id %}" type='button'><span class='glyphicon glyphicon-trash'/></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -61,4 +61,20 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('.param-edit').click(function() {
|
||||
var button = $(this);
|
||||
|
||||
launchModalForm(button.attr('url'), {
|
||||
reload: true,
|
||||
});
|
||||
});
|
||||
|
||||
$('.param-delete').click(function() {
|
||||
var button = $(this);
|
||||
|
||||
launchModalForm(button.attr('url'), {
|
||||
reload: true,
|
||||
});
|
||||
});
|
||||
|
||||
{% endblock %}
|
@ -24,6 +24,7 @@ part_parameter_urls = [
|
||||
|
||||
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+)/delete/', views.PartParameterDelete.as_view(), name='part-param-delete'),
|
||||
|
||||
]
|
||||
|
||||
|
@ -1469,6 +1469,14 @@ class PartParameterEdit(AjaxUpdateView):
|
||||
return form
|
||||
|
||||
|
||||
class PartParameterDelete(AjaxDeleteView):
|
||||
""" View for deleting a PartParameter """
|
||||
|
||||
model = PartParameter
|
||||
ajax_template_name = 'part/param_delete.html'
|
||||
ajax_form_title = 'Delete Part Parameter'
|
||||
|
||||
|
||||
class CategoryDetail(DetailView):
|
||||
""" Detail view for PartCategory """
|
||||
model = PartCategory
|
||||
|
Loading…
Reference in New Issue
Block a user