Download Pathway Functionality (#38)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#38
This commit is contained in:
2025-07-31 01:30:16 +12:00
parent aec61151ce
commit 79b4b1586c
5 changed files with 96 additions and 7 deletions

View File

@ -0,0 +1,35 @@
{% load static %}
<!-- Download Pathway -->
<div id="download_pathway_modal" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Download Pathway</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
By clicking on Download the Pathway will be converted into a CSV and directly downloaded.
<form id="download-pathway-modal-form" accept-charset="UTF-8" action="{{ pathway.url }}"
data-remote="true" method="GET">
<input type="hidden" name="download" value="true"/>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="download-pathway-modal-submit">Download</button>
</div>
</div>
</div>
</div>
<script>
$(function () {
$('#download-pathway-modal-submit').click(function (e) {
e.preventDefault();
$('#download-pathway-modal-form').submit();
});
})
</script>