Support adding and removing attributes of error templates

This commit is contained in:
Maximilian Grundke
2017-07-12 21:25:18 +02:00
parent 24fd142d3c
commit 28605fbe9b
8 changed files with 67 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
$(function() {
if ($.isController('error_templates')) {
$('#add-attribute').find('button').on('click', function () {
$.ajax(location + '/attribute.json', {
method: 'POST',
data: {
_method: 'PUT',
dataType: 'json',
error_template_attribute_id: $('#add-attribute').find('select').val()
}
}).success(function () {
location.reload();
}).error(function (error) {
$.flash.danger({text: error.statusText});
});
});
}
});