more, view and edit broken

This commit is contained in:
2025-06-11 05:23:52 -05:00
parent 38cf4d962d
commit e7a0f5b1be
38 changed files with 1008 additions and 141 deletions

View 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 scientificname 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 %}
&mdash;
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<button type="submit" class="btn btn-success">Confirm &amp; 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 %}

View 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 %}