Implemented GPX tracks delete
This commit is contained in:
parent
c142f67c3e
commit
563b5eebe6
@ -24,6 +24,7 @@
|
|||||||
<orderEntry type="library" name="bootstrap" level="application" />
|
<orderEntry type="library" name="bootstrap" level="application" />
|
||||||
<orderEntry type="library" name="popper.js" level="application" />
|
<orderEntry type="library" name="popper.js" level="application" />
|
||||||
<orderEntry type="library" name="@turf/turf" level="application" />
|
<orderEntry type="library" name="@turf/turf" level="application" />
|
||||||
|
<orderEntry type="library" name="leaflet-gpx" level="application" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PackageRequirementsSettings">
|
<component name="PackageRequirementsSettings">
|
||||||
<option name="removeUnused" value="true" />
|
<option name="removeUnused" value="true" />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptLibraryMappings">
|
<component name="JavaScriptLibraryMappings">
|
||||||
<file url="file://$PROJECT_DIR$" libraries="{@turf/turf, bootstrap, jquery, leaflet, leaflet-control-geocoder, leaflet.draw, popper.js}" />
|
<file url="file://$PROJECT_DIR$" libraries="{@turf/turf, bootstrap, jquery, leaflet, leaflet-control-geocoder, leaflet-gpx, leaflet.draw, popper.js}" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -125,6 +125,16 @@ def upload_gpx():
|
|||||||
return jsonify({'message': 'GPX file uploaded successfully'})
|
return jsonify({'message': 'GPX file uploaded successfully'})
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/delete_gpx/<int:gpx_id>/<int:sar_id>', methods=['GET'])
|
||||||
|
@login_required
|
||||||
|
def delete_gpx(gpx_id, sar_id):
|
||||||
|
gpx_file = GPSTrack.query.get_or_404(gpx_id)
|
||||||
|
db.session.delete(gpx_file)
|
||||||
|
db.session.commit()
|
||||||
|
flash('GPX file deleted successfully!', 'success')
|
||||||
|
return redirect(url_for('sar_details', id=sar_id))
|
||||||
|
|
||||||
|
|
||||||
def custom_flask_response(data, status=200, headers=None, mimetype='application/json'):
|
def custom_flask_response(data, status=200, headers=None, mimetype='application/json'):
|
||||||
# TODO: fix filename encoding -- need to support unicode
|
# TODO: fix filename encoding -- need to support unicode
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
||||||
<script src="https://unpkg.com/leaflet-control-geocoder@2.4.0/dist/Control.Geocoder.js"></script>
|
<script src="https://unpkg.com/leaflet-control-geocoder@2.4.0/dist/Control.Geocoder.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-gpx/1.7.0/gpx.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js"></script>
|
||||||
<script src='https://unpkg.com/@turf/turf@6/turf.min.js'></script>
|
<script src='https://unpkg.com/@turf/turf@6/turf.min.js'></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
|
||||||
|
@ -102,10 +102,9 @@
|
|||||||
</li>
|
</li>
|
||||||
{% set ns.drawn = true %}
|
{% set ns.drawn = true %}
|
||||||
<!-- Button to delete GPX Upload Modal -->
|
<!-- Button to delete GPX Upload Modal -->
|
||||||
<button type="button" class="gpx-delete-button" data-toggle="modal"
|
<button type="button" class="gpx-delete-button">
|
||||||
data-target="#deleteGPXModal"
|
<a href="{{ url_for('delete_gpx', gpx_id=gpx_track.id, sar_id=sar.SARCall.id ) }}">
|
||||||
data-comment-id="{{ comment.id }}">
|
🗑</a>
|
||||||
🗑
|
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user