FEATURE: add copying of templates

This commit is contained in:
Michal Kváček
2016-03-07 16:27:00 +01:00
parent fa97ccc032
commit 6e6be7f790
4 changed files with 111 additions and 10 deletions
@@ -40,12 +40,20 @@
var templateId = link.data ('template-id');
var templateName = link.data ('template-name');
var newTemplateName = prompt ("@lang('admin/templates.newTemplateName')", templateName + "_"+"@lang('admin/templates.newTemplateNameSuffix')");
var newTemplateName = prompt ("@lang('admin/templates.newTemplateName')", templateName + "_" + "@lang('admin/templates.newTemplateNameSuffix')");
// no name given - give up
if (newTemplateName == null) return;
$.ajax({
'url': '{{route('templates.copy')}}}'
// copy given template
$.post ('{{route('templates.postCopy')}}', {
templateId: templateId,
newName: newTemplateName,
_token: "{{csrf_token()}}"
}, function (data) {
if (data.status == 'success') {
location.reload ();
}
});
});
</script>