From ba43e683c24b1210234cc21f96e5d461fd69822a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Aug 2015 18:27:04 -0500 Subject: [PATCH] Added ability to delete templates --- static/js/app/templates.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/js/app/templates.js b/static/js/app/templates.js index 486b9c91..f8cbd94e 100644 --- a/static/js/app/templates.js +++ b/static/js/app/templates.js @@ -59,6 +59,16 @@ function dismiss(){ $("#html_editor").val("") } +function deleteTemplate(idx){ + if (confirm("Delete " + templates[idx].name + "?")){ + api.templateId.delete(templates[idx].id) + .success(function(data){ + successFlash(data.message) + load() + }) + } +} + function attach(files){ attachmentsTable = $("#attachmentsTable").DataTable(); $.each(files, function(i, file){ @@ -144,7 +154,7 @@ function load(){ "
\ -
" ]).draw()