csv upload

This commit is contained in:
2025-06-08 17:47:49 +02:00
parent ab9e07f29b
commit f71cb7d24a
2 changed files with 167 additions and 2 deletions

View File

@@ -6,7 +6,18 @@
<div class="bg-white rounded-lg shadow p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold">All Plants</h2>
<button id="show-add-plant" class="btn-main px-6 py-2 font-semibold">Add Plant</button>
<div class="flex gap-4">
<a href="{{ url_for('download_plants_template') }}" class="btn-secondary px-6 py-2 font-semibold flex items-center gap-2">
<i class="fas fa-file-download"></i> Download Template
</a>
<form id="csv-upload-form" method="POST" action="{{ url_for('upload_plants_csv') }}" enctype="multipart/form-data" class="inline">
<input type="file" name="csv_file" id="csv_file" accept=".csv" class="hidden" onchange="this.form.submit()">
<button type="button" onclick="document.getElementById('csv_file').click()" class="btn-secondary px-6 py-2 font-semibold flex items-center gap-2">
<i class="fas fa-file-import"></i> Import CSV
</button>
</form>
<button id="show-add-plant" class="btn-main px-6 py-2 font-semibold">Add Plant</button>
</div>
</div>
<div id="add-plant-form-card" class="hidden mb-8">
<div class="bg-gray-50 rounded-lg shadow p-6 max-w-2xl mx-auto" style="overflow:visible;">