42 lines
1.2 KiB
HTML
42 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Upload CSV File</title>
|
|
</head>
|
|
<body>
|
|
<h1>Upload CSV File</h1>
|
|
|
|
<!-- Display flash messages -->
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<p><strong>{{ category }}:</strong> {{ message }}</p>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
<!-- Display validation errors if any -->
|
|
{% if errors %}
|
|
<details>
|
|
<summary>
|
|
Errors found in the CSV file (click to expand):
|
|
</summary>
|
|
<ul>
|
|
{% for error in errors %}
|
|
<li>{{ error }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</details>
|
|
{% endif %}
|
|
|
|
<!-- Upload form -->
|
|
<form action="/uploadcsv" method="POST" enctype="multipart/form-data">
|
|
<label for="file">Choose a CSV file:</label>
|
|
<input type="file" id="file" name="file" accept=".csv" required>
|
|
<br><br>
|
|
<button type="submit">Upload</button>
|
|
</form>
|
|
</body>
|
|
</html> |