django templates input

This commit is contained in:
zakhy 2025-02-19 11:14:06 +07:00
parent 80a4c6e929
commit 1e022c5284

View File

@ -37,8 +37,7 @@
<div class="card-body">
<div class="form-group">
<label for="name">Наименование</label>
<input type="text" class="form-control" id="name"
placeholder="Введите имя слоя">
{{ form.name }}
</div>
<div class="form-group">
<label for="exampleInputFile">Файл</label>
@ -53,11 +52,7 @@
autofocus=""
id="id_layer_file_input" style="visibility:hidden; display: none"
accept=".kml, .json, .dxf">
<input type="hidden" name="id_file"
class="form-control"
autofocus=""
id="id_file" style="visibility:hidden; display: none"
accept=".json">
{{ form.file.as_hidden }}
</div>
</div>
</div>
@ -395,7 +390,7 @@
const geojson = new ol.format.GeoJSON().writeFeatures(features, {
featureProjection: 'EPSG:3857'
});
const name = document.querySelector("#name")
const name = document.querySelector("#id_name")
const formData = new FormData();
formData.append('file', new Blob([geojson], {type: 'application/json'}), 'export.geojson');