mirror of https://github.com/gophish/gophish
Added ability to delete templates
parent
d79de6263d
commit
ba43e683c2
|
@ -59,6 +59,16 @@ function dismiss(){
|
||||||
$("#html_editor").val("")
|
$("#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){
|
function attach(files){
|
||||||
attachmentsTable = $("#attachmentsTable").DataTable();
|
attachmentsTable = $("#attachmentsTable").DataTable();
|
||||||
$.each(files, function(i, file){
|
$.each(files, function(i, file){
|
||||||
|
@ -144,7 +154,7 @@ function load(){
|
||||||
"<div class='pull-right'><button class='btn btn-primary' data-toggle='modal' data-target='#modal' onclick='edit(" + i + ")'>\
|
"<div class='pull-right'><button class='btn btn-primary' data-toggle='modal' data-target='#modal' onclick='edit(" + i + ")'>\
|
||||||
<i class='fa fa-pencil'></i>\
|
<i class='fa fa-pencil'></i>\
|
||||||
</button>\
|
</button>\
|
||||||
<button class='btn btn-danger' onclick='alert(\"test\")'>\
|
<button class='btn btn-danger' onclick='deleteTemplate(" + i + ")'>\
|
||||||
<i class='fa fa-trash-o'></i>\
|
<i class='fa fa-trash-o'></i>\
|
||||||
</button></div>"
|
</button></div>"
|
||||||
]).draw()
|
]).draw()
|
||||||
|
|
Loading…
Reference in New Issue