summaryrefslogtreecommitdiff
path: root/views/partials
diff options
context:
space:
mode:
authorlowercasename <raphaelkabo@gmail.com>2020-01-04 20:46:33 +1100
committerlowercasename <raphaelkabo@gmail.com>2020-01-04 20:46:33 +1100
commit752382ee9f37ce5e3765f9931692020116ad81ff (patch)
tree193103b5352eadfd5c914a4c010829a9317a4624 /views/partials
parent913f3d764547bb36ead71922f6dfac9e83f16c62 (diff)
Event image deletion functionality
Diffstat (limited to 'views/partials')
-rw-r--r--views/partials/editeventmodal.handlebars17
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