2026-02-08 04:37:05 +00:00
|
|
|
{{ template "sync/layout/authenticated.html" . }}
|
|
|
|
|
{{ define "title" }}Pool Upload{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ define "extraheader" }}
|
2026-02-16 01:11:09 +00:00
|
|
|
<script
|
|
|
|
|
type="text/javascript"
|
|
|
|
|
src="//unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js"
|
|
|
|
|
></script>
|
|
|
|
|
<script src="/static/js/map-libre-test.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
const CSV_FILE_ID={{ .CSVFileID }};
|
|
|
|
|
const ORG_ID={{ .User.Organization.ID }}
|
2026-02-16 16:46:47 +00:00
|
|
|
function handleShowIssuesOnly() {
|
|
|
|
|
const checkboxShowIssuesOnly = document.getElementById("showIssuesOnly");
|
|
|
|
|
const allRows = document.querySelectorAll('tr');
|
|
|
|
|
if (checkboxShowIssuesOnly.checked) {
|
|
|
|
|
allRows.forEach(row => {
|
|
|
|
|
if (!row.classList.contains("has-error")) {
|
|
|
|
|
row.style.display = "none";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
allRows.forEach(row => {
|
|
|
|
|
row.style.display = "table-row";
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-16 01:11:09 +00:00
|
|
|
function onLoad() {
|
|
|
|
|
const map = document.querySelector("map-libre-test");
|
|
|
|
|
map.addEventListener("load", (event) => {
|
2026-02-16 16:38:04 +00:00
|
|
|
map.addSource('tegola-nidus-fileupload', {
|
2026-02-16 01:11:09 +00:00
|
|
|
'type': 'vector',
|
|
|
|
|
'tiles': [
|
2026-02-16 16:38:04 +00:00
|
|
|
`{{.URL.Tegola}}maps/fileupload/{z}/{x}/{y}?csv_file=${CSV_FILE_ID}&organization_id=${ORG_ID}`
|
2026-02-16 01:11:09 +00:00
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
map.addLayer({
|
|
|
|
|
'id': 'pool',
|
2026-02-16 16:38:04 +00:00
|
|
|
'source': 'tegola-nidus-fileupload',
|
|
|
|
|
'source-layer': 'pool',
|
2026-02-16 01:11:09 +00:00
|
|
|
'type': 'circle',
|
|
|
|
|
'paint': {
|
2026-02-16 16:38:04 +00:00
|
|
|
'circle-color': "#91b979",
|
2026-02-16 01:11:09 +00:00
|
|
|
'circle-radius': 7,
|
|
|
|
|
'circle-stroke-width': 2,
|
2026-02-16 16:38:04 +00:00
|
|
|
'circle-stroke-color': "#7aab5f"
|
2026-02-16 01:11:09 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2026-02-16 16:46:47 +00:00
|
|
|
|
|
|
|
|
const checkboxShowIssuesOnly = document.getElementById("showIssuesOnly");
|
|
|
|
|
checkboxShowIssuesOnly.onclick = handleShowIssuesOnly;
|
|
|
|
|
// Set the correct state if the browser remembers the state of the checkbox
|
|
|
|
|
handleShowIssuesOnly();
|
2026-02-16 01:11:09 +00:00
|
|
|
}
|
|
|
|
|
document.addEventListener('DOMContentLoaded', onLoad);
|
|
|
|
|
</script>
|
2026-02-08 04:37:05 +00:00
|
|
|
{{ end }}
|
|
|
|
|
{{ define "content" }}
|
|
|
|
|
<div class="container mt-4 results-container">
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
2026-02-09 19:13:42 +00:00
|
|
|
<h2>Upload Results: {{ .Upload.Name }}</h2>
|
|
|
|
|
{{ if eq .Upload.Status "parsed" }}
|
|
|
|
|
<span class="badge bg-success rounded-pill">
|
|
|
|
|
<i class="bi bi-check-circle me-1"></i> File Parsed Successfully
|
|
|
|
|
</span>
|
|
|
|
|
{{ else if eq .Upload.Status "error" }}
|
|
|
|
|
<span class="badge bg-danger rounded-pill">
|
|
|
|
|
<i class="bi bi-exclamation me-1"></i> File Has Problems
|
|
|
|
|
</span>
|
|
|
|
|
{{ else if eq .Upload.Status "uploaded" }}
|
|
|
|
|
<span class="badge bg-info rounded-pill">
|
|
|
|
|
<i class="bi bi-arrow-clockwise me-1"></i> File Is Processing
|
|
|
|
|
</span>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<span class="badge bg-warning rounded-pill">
|
|
|
|
|
<i class="bi bi-question me-1"></i> Unknown status
|
|
|
|
|
</span>
|
|
|
|
|
{{ end }}
|
2026-02-08 04:37:05 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<div class="card summary-card h-100 border-primary">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-09 19:17:33 +00:00
|
|
|
<h1 class="display-4 text-primary">{{ .Upload.CountExisting }}</h1>
|
2026-02-08 04:37:05 +00:00
|
|
|
<h5>Existing Pools</h5>
|
|
|
|
|
<p class="text-muted">Matches found in previous records</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<div class="card summary-card h-100 border-success">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-09 19:17:33 +00:00
|
|
|
<h1 class="display-4 text-success">{{ .Upload.CountNew }}</h1>
|
2026-02-08 04:37:05 +00:00
|
|
|
<h5>New Pools</h5>
|
|
|
|
|
<p class="text-muted">Not found in existing records</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<div class="card summary-card h-100 border-warning">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-14 04:08:22 +00:00
|
|
|
<h1 class="display-4 text-warning">{{ .Upload.CountOutside }}</h1>
|
2026-02-08 04:37:05 +00:00
|
|
|
<h5>Outside District</h5>
|
|
|
|
|
<p class="text-muted">Potential geocoding errors</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-16 01:11:09 +00:00
|
|
|
<div class="card mb-4">
|
|
|
|
|
<map-libre-test></map-libre-test>
|
|
|
|
|
</div>
|
2026-02-08 04:37:05 +00:00
|
|
|
<div class="card mb-4">
|
|
|
|
|
<div
|
|
|
|
|
class="card-header bg-light d-flex justify-content-between align-items-center"
|
|
|
|
|
>
|
|
|
|
|
<h5 class="mb-0">Data Preview</h5>
|
|
|
|
|
<div class="form-check form-switch">
|
|
|
|
|
<input class="form-check-input" type="checkbox" id="showIssuesOnly" />
|
|
|
|
|
<label class="form-check-label" for="showIssuesOnly"
|
|
|
|
|
>Show issues only</label
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
2026-02-14 04:36:47 +00:00
|
|
|
{{ range .Upload.Errors }}
|
|
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
|
<i class="bi bi-exclamation-triangle me-2"></i>
|
|
|
|
|
<strong>Error:</strong>{{ .Message }}
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|
2026-02-14 05:03:32 +00:00
|
|
|
{{ if eq .Upload.Status "uploaded" }}
|
|
|
|
|
<div class="alert alert-info" role="alert">
|
2026-02-14 04:36:47 +00:00
|
|
|
<i class="bi bi-exclamation-triangle me-2"></i>
|
2026-02-14 05:03:32 +00:00
|
|
|
<strong>Working:</strong> File is still processing... refresh this
|
|
|
|
|
page in a bit to see updates.
|
2026-02-14 04:36:47 +00:00
|
|
|
</div>
|
|
|
|
|
{{ else }}
|
2026-02-14 05:03:32 +00:00
|
|
|
{{ if eq (len .Upload.Pools) 0 }}
|
|
|
|
|
<div class="alert alert-warning" role="alert">
|
|
|
|
|
<i class="bi bi-exclamation-triangle me-2"></i>
|
|
|
|
|
<strong>Warning:</strong> No pools could be understood from your
|
|
|
|
|
file.
|
|
|
|
|
</div>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
<table class="table table-hover table-striped">
|
|
|
|
|
<thead class="table-light">
|
2026-02-14 04:36:47 +00:00
|
|
|
<tr>
|
2026-02-16 16:38:04 +00:00
|
|
|
<th></th>
|
2026-02-14 05:03:32 +00:00
|
|
|
<th>Street</th>
|
|
|
|
|
<th>City</th>
|
|
|
|
|
<th>Post</th>
|
|
|
|
|
<th>Status</th>
|
|
|
|
|
<th>Condition</th>
|
2026-02-16 16:38:04 +00:00
|
|
|
<th>Tags</th>
|
2026-02-14 04:36:47 +00:00
|
|
|
</tr>
|
2026-02-14 05:03:32 +00:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{{ range .Upload.Pools }}
|
2026-02-16 16:38:04 +00:00
|
|
|
<tr {{ if gt (len .Errors) 0 }}class="has-error"{{ end }}>
|
|
|
|
|
<td>
|
|
|
|
|
{{ if gt (len .Errors) 0 }}
|
|
|
|
|
<i
|
|
|
|
|
class="bi bi-info-circle-fill text-primary ms-1"
|
|
|
|
|
data-bs-toggle="tooltip"
|
|
|
|
|
data-bs-placement="top"
|
|
|
|
|
title="{{ range .Errors }}{{ .Message }}{{ end }}"
|
|
|
|
|
></i>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</td>
|
|
|
|
|
|
2026-02-14 05:03:32 +00:00
|
|
|
<td>{{ .Street }}</td>
|
|
|
|
|
<td>{{ .City }}</td>
|
|
|
|
|
<td>{{ .PostalCode }}</td>
|
|
|
|
|
{{ if eq .Status "new" }}
|
|
|
|
|
<td>
|
|
|
|
|
<span class="badge bg-success status-badge">New</span>
|
|
|
|
|
</td>
|
|
|
|
|
{{ else if eq .Status "existing" }}
|
|
|
|
|
<td>
|
|
|
|
|
<span class="badge bg-primary status-badge"
|
|
|
|
|
>Existing</span
|
|
|
|
|
>
|
|
|
|
|
</td>
|
|
|
|
|
{{ else if eq .Status "outside" }}
|
|
|
|
|
<td>
|
|
|
|
|
<span class="badge bg-warning status-badge"
|
|
|
|
|
>Outside</span
|
|
|
|
|
>
|
|
|
|
|
</td>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<td>
|
|
|
|
|
<span class="badge bg-warning status-badge"
|
|
|
|
|
>{{ .Status }}</span
|
|
|
|
|
>
|
|
|
|
|
</td>
|
|
|
|
|
{{ end }}
|
2026-02-14 15:42:33 +00:00
|
|
|
<td>{{ .Condition }}</td>
|
2026-02-16 16:38:04 +00:00
|
|
|
<td>{{ len .Tags }}</td>
|
2026-02-14 05:03:32 +00:00
|
|
|
</tr>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|
2026-02-14 04:36:47 +00:00
|
|
|
{{ end }}
|
2026-02-08 04:37:05 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card mb-4">
|
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
|
<h5 class="mb-0">Notes & Recommendations</h5>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<p><strong>Issues detected:</strong></p>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
4 pools appear to be outside district boundaries (possible
|
|
|
|
|
geocoding errors)
|
|
|
|
|
</li>
|
|
|
|
|
<li>All required fields are present and properly formatted</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="alert alert-info" role="alert">
|
|
|
|
|
<i class="bi bi-info-circle me-2"></i>
|
|
|
|
|
<strong>Note:</strong> You may proceed with this upload or edit your
|
|
|
|
|
CSV file to fix the issues identified.
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="d-flex justify-content-between mt-4 mb-5">
|
2026-02-14 04:38:17 +00:00
|
|
|
<a href="{{ .URL.PoolCSVUpload }}" class="btn btn-outline-secondary">
|
2026-02-08 04:37:05 +00:00
|
|
|
<i class="bi bi-arrow-left me-1"></i> Upload Edited File
|
|
|
|
|
</a>
|
|
|
|
|
<button class="btn btn-primary" id="confirmUploadBtn">
|
|
|
|
|
<i class="bi bi-check2 me-1"></i> Confirm and Submit Data
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|