Add link from root upload page to upload pool detail page.
This commit is contained in:
parent
a776c83557
commit
c8f5408f27
8 changed files with 20 additions and 85 deletions
|
|
@ -61,6 +61,10 @@ func bigNumber(n int) string {
|
|||
}
|
||||
func displayUploadStatus(s string) string {
|
||||
switch s {
|
||||
case "committed":
|
||||
return "committed"
|
||||
case "discarded":
|
||||
return "Discarded"
|
||||
case "error":
|
||||
return "Bad upload"
|
||||
case "parsed":
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
{{ template "sync/layout/authenticated.html" . }}
|
||||
|
||||
{{ define "title" }}Pool List{{ end }}
|
||||
{{ define "extraheader" }}
|
||||
<script>
|
||||
function onLoaded() {
|
||||
document.querySelectorAll("tr.clickable-row").forEach((el) => {
|
||||
el.addEventListener("click", (e) => {
|
||||
let element = e.target;
|
||||
while (element.nodeName != "TR") {
|
||||
element = element.parentElement;
|
||||
}
|
||||
let uploadId = element.dataset.uploadId;
|
||||
window.location = "/pool/upload/" + uploadId;
|
||||
});
|
||||
});
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", onLoaded);
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<div class="container-fluid py-3">
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header">
|
||||
<h1>Pool CSV Uploads</h1>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>Uploaded</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .C.Uploads }}
|
||||
<tr class="clickable-row" data-upload-id="{{ .ID }}">
|
||||
<td>{{ .Status }}</td>
|
||||
<td>{{ .Created|timeRelative }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a class="btn btn-primary" href="{{ .URL.PoolCSVUpload }}"
|
||||
>Do an upload</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
@ -133,7 +133,7 @@
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<form
|
||||
action="{{ .URL.PoolCSVUpload }}"
|
||||
action="{{ .URL.UploadCSVPool }}"
|
||||
method="POST"
|
||||
enctype="multipart/form-data"
|
||||
>
|
||||
|
|
@ -36,16 +36,9 @@
|
|||
Upload spreadsheets with addresses and contact information of
|
||||
unmaintained pools that may breed mosquitoes.
|
||||
</p>
|
||||
<p class="text-muted small">Supported formats: .xlsx, .csv, .xls</p>
|
||||
<div class="mb-3">
|
||||
<label for="greenPoolFile" class="form-label"
|
||||
>Select file to import</label
|
||||
>
|
||||
<input class="form-control" type="file" id="greenPoolFile" />
|
||||
</div>
|
||||
<button type="button" class="btn btn-success">
|
||||
<i class="bi bi-upload me-2"></i>Upload Green Pool Data
|
||||
</button>
|
||||
<a class="btn btn-primary" href="{{ .URL.UploadCSVPool }}">
|
||||
<i class="bi bi-upload me-2"></i>Upload Green Pool Data</a
|
||||
>
|
||||
</div>
|
||||
<div class="card-footer bg-white text-muted">
|
||||
<small><i class="bi bi-clock"></i> Last import: 02/15/2023</small>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue