more, view and edit broken
This commit is contained in:
72
plugins/utility/templates/utility/review.html
Normal file
72
plugins/utility/templates/utility/review.html
Normal file
@ -0,0 +1,72 @@
|
||||
{% extends "core_ui/base.html" %}
|
||||
{% block title %}Review Suggested Matches{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-4">
|
||||
<h2 class="mb-4">🔍 Review Suggested Matches</h2>
|
||||
<p>
|
||||
Confirm the suggested scientific‐name replacements below.
|
||||
Only checked boxes (“Confirm”) will override the raw user input.
|
||||
</p>
|
||||
|
||||
{# Display flash messages (error, success, etc.) #}
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div
|
||||
class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show"
|
||||
role="alert"
|
||||
>
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{% if review_list and review_list|length > 0 %}
|
||||
<form method="POST">
|
||||
{# Hidden CSRF token #}
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Common Name</th>
|
||||
<th>User Input (Scientific Name)</th>
|
||||
<th>Suggested Match</th>
|
||||
<th>Confirm</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in review_list %}
|
||||
<tr>
|
||||
<td>{{ row.name }}</td>
|
||||
<td>{{ row.sci_name }}</td>
|
||||
<td>{{ row.suggested or '-' }}</td>
|
||||
<td>
|
||||
{% if row.suggested %}
|
||||
<input
|
||||
type="checkbox"
|
||||
name="confirm_{{ row.uuid }}"
|
||||
aria-label="Confirm suggested match for {{ row.uuid }}"
|
||||
>
|
||||
{% else %}
|
||||
—
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="submit" class="btn btn-success">Confirm & Import</button>
|
||||
<a href="{{ url_for('utility.upload') }}" class="btn btn-secondary ms-2">Cancel</a>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
No rows to review. <a href="{{ url_for('utility.upload') }}">Upload another CSV?</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
46
plugins/utility/templates/utility/upload.html
Normal file
46
plugins/utility/templates/utility/upload.html
Normal file
@ -0,0 +1,46 @@
|
||||
{% extends "core_ui/base.html" %}
|
||||
{% block title %}CSV Import{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-4">
|
||||
<h2 class="mb-4">📤 Import Plant Data</h2>
|
||||
|
||||
{# Display flash messages (error, success, etc.) #}
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div
|
||||
class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show"
|
||||
role="alert"
|
||||
>
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{# Hidden CSRF token #}
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="file" class="form-label">Choose CSV File</label>
|
||||
<input
|
||||
type="file"
|
||||
class="form-control"
|
||||
id="file"
|
||||
name="file"
|
||||
accept=".csv,.zip"
|
||||
required
|
||||
>
|
||||
<div class="form-text">
|
||||
Required columns: <code>uuid</code>, <code>plant_type</code>, <code>name</code><br>
|
||||
Optional columns: <code>scientific_name</code>, <code>mother_uuid</code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-success">Upload</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user