diff options
Diffstat (limited to 'views/partials')
| -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  | 
