diff options
author | Tom Parker-Shemilt <palfrey@tevp.net> | 2020-01-07 09:38:25 +0000 |
---|---|---|
committer | Tom Parker-Shemilt <palfrey@tevp.net> | 2020-01-07 09:38:25 +0000 |
commit | bb0f9160de2b02fd1a13f40f7702893238b3fe04 (patch) | |
tree | 4c9e70b458baaab4e9cdb49a5992e9af25ea0bce /views/partials/editeventmodal.handlebars | |
parent | ae5e25d7d8a1edac542adf5e5510105aca76c0d9 (diff) | |
parent | c5835cbdbcfe3abda637e298a89b36ebb058c22a (diff) |
Merge branch 'master' into docker-travis
Diffstat (limited to 'views/partials/editeventmodal.handlebars')
-rw-r--r-- | views/partials/editeventmodal.handlebars | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/views/partials/editeventmodal.handlebars b/views/partials/editeventmodal.handlebars index ce3cdcd..2227473 100644 --- a/views/partials/editeventmodal.handlebars +++ b/views/partials/editeventmodal.handlebars @@ -62,6 +62,9 @@ <input type="file" name="imageUpload" id="image-upload" /> </div> <small class="form-text">Recommended dimensions (w x h): 920px by 300px.</small> + {{#if eventData.image}} + <button type="button" class="btn btn-danger" id="deleteImage">Delete image</button> + {{/if}} </div> <div class="form-group"> <div class="mb-2">Options</div> @@ -138,4 +141,16 @@ </div> </div> </div> -</div>
\ No newline at end of file +</div> + +<script> +$('#deleteImage').click(function() { + $.post('/deleteimage/{{eventData.id}}/{{eventData.editToken}}', function(response) { + if (response === "Success") { + location.reload(); + } else { + alert(response); + } + }); +}) +</script>
\ No newline at end of file |