Update web/templates/import_result.html

This commit is contained in:
Joshua Laymon 2025-08-22 13:22:18 +00:00
parent 081db63b17
commit f8c29935ff

View File

@ -1,58 +1,105 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block body_class %}themed-bg{% endblock %} {% block body_class %}themed-bg{% endblock %}
{% block content %}
<div class="container">
<div class="card">
<h1 class="page-title">{{ dry_run|yesno:"Dry-run Preview,Import Result" }}</h1>
<p>{{ report }}</p>
{% if errors %} {% block content %}
<h3>Errors (first {{ errors|length }})</h3> <div class="result-wrap">
<ul class="small">
{% for e in errors %} <div class="card">
<li>{{ e }}</li> <h1 class="page-title">Import Results</h1>
{% endfor %}
</ul> {% if dry_run %}
<div class="alert alert-info">Dry run only — no changes were saved.</div>
{% endif %} {% endif %}
{% if rows %} {% if report.header_ok is defined and not report.header_ok %}
<h3 style="margin-top:10px;">Preview (first {{ rows|length }})</h3> <div class="alert alert-warning">
<div class="small muted">Truncated fields shown for readability.</div> The first row didnt match the expected header; a clean header was injected automatically.
<table class="table" style="margin-top:8px;"> </div>
{% endif %}
<div class="meta-grid" style="margin-top:10px;">
{% if report.total_rows is not None %}
<div class="meta-item">
<div class="meta-label">Total Rows</div>
<div class="meta-value">{{ report.total_rows }}</div>
</div>
{% endif %}
{% if report.created is not None %}
<div class="meta-item">
<div class="meta-label">Created</div>
<div class="meta-value">{{ report.created }}</div>
</div>
{% endif %}
{% if report.updated is not None %}
<div class="meta-item">
<div class="meta-label">Updated</div>
<div class="meta-value">{{ report.updated }}</div>
</div>
{% endif %}
{% if report.skipped is not None %}
<div class="meta-item">
<div class="meta-label">Skipped</div>
<div class="meta-value">{{ report.skipped }}</div>
</div>
{% endif %}
{% if report.errors is not None %}
<div class="meta-item">
<div class="meta-label">Errors</div>
<div class="meta-value">{{ report.errors }}</div>
</div>
{% endif %}
</div>
</div>
{% if report.columns and report.preview %}
<div class="card" style="margin-top:16px;">
<h2 class="page-title">Preview</h2>
<div class="muted small" style="margin-bottom:10px;">
Showing up to {{ report.preview|length }} rows.
</div>
<div style="overflow:auto;">
<table class="table">
<thead> <thead>
<tr> <tr>
<th>#</th> {% for c in report.columns %}
<th>Subject</th><th>Illustration</th><th>Application</th><th>Scripture</th> <th>{{ c }}</th>
<th>Source</th><th>Talk Title</th><th>Talk #</th><th>Code</th><th>Date</th><th>Date Edited</th> {% endfor %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for rownum, r in rows %} {% for row in report.preview %}
<tr> <tr>
<td>{{ rownum }}</td> {% for cell in row %}
<td>{{ r.Subject }}</td> <td>{{ cell }}</td>
<td>{{ r.Illustration }}</td> {% endfor %}
<td>{{ r.Application }}</td>
<td>{{ r.Scripture }}</td>
<td>{{ r.Source }}</td>
<td>{{ r."Talk Title" }}</td>
<td>{{ r."Talk Number" }}</td>
<td>{{ r.Code }}</td>
<td>{{ r.Date }}</td>
<td>{{ r."Date Edited" }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div>
</div>
{% else %}
<div class="card" style="margin-top:16px;">
<p class="muted">No preview rows to display.</p>
</div>
{% endif %} {% endif %}
<div class="result-toolbar" style="margin-top:12px;"> {% if report.problems %}
<div class="rt-left"></div> <div class="card" style="margin-top:16px;">
<div class="rt-right"> <h2 class="page-title">Problems</h2>
<a class="btn btn-primary" href="{% url 'import_wizard' %}">Back to Import</a> <ul class="muted">
<a class="btn btn-secondary" href="{% url 'settings_home' %}">Close</a> {% for p in report.problems %}
</div> <li>{{ p }}</li>
{% endfor %}
</ul>
</div> </div>
{% endif %}
<div class="result-toolbar" style="margin-top:16px;">
<a class="btn btn-secondary" href="{% url 'import_wizard' %}">← Back to Import</a>
<a class="btn btn-primary" href="{% url 'settings_home' %}">Settings</a>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}