nidus-sync/public-report/template/status-by-id.html

191 lines
5.4 KiB
HTML
Raw Normal View History

2026-01-09 20:08:29 +00:00
{{template "base.html" .}}
{{define "title"}}Status of report {{.Report.ID|publicReportID}}{{end}}
{{define "extraheader"}}
<script src='https://api.mapbox.com/mapbox-gl-js/v3.17.0-beta.1/mapbox-gl.js'></script>
<script src="/static/js/map-with-markers.js"></script>
2026-01-09 20:08:29 +00:00
<style>
.timeline {
border-left: 3px solid #dee2e6;
padding-left: 20px;
margin-left: 10px;
}
.timeline-item {
position: relative;
margin-bottom: 25px;
}
.timeline-item:before {
content: '';
position: absolute;
left: -29px;
top: 0;
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #0d6efd;
}
.timeline-date {
font-size: 0.85rem;
color: #6c757d;
}
.map-container {
height: 300px;
}
@media (max-width: 768px) {
.map-container {
height: 200px;
}
}
.status-badge {
font-size: 1rem;
}
</style>
<script>
const GEOJSON_LOCATION = {{.Report.Location|json}};
const GEOJSON_IMAGE_LOCATIONS = [
{{ range .Report.Images }}
{{ .Location|json }},
{{ end }}
];
function onLoad() {
const map = document.querySelector("map-with-markers");
map.addEventListener("load", (event) => {
map.jumpTo({
center: GEOJSON_LOCATION.coordinates,
zoom: 14,
});
map.addMarker(GEOJSON_LOCATION.coordinates, "#FF0000");
});
}
document.addEventListener("DOMContentLoaded", onLoad);
</script>
2026-01-09 20:08:29 +00:00
{{end}}
{{define "content"}}
2026-01-09 21:31:45 +00:00
<div class="container my-4">
<!-- Report ID and Status Section -->
<div class="card mb-4">
<div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
<h5 class="mb-0">Report {{.Report.ID|publicReportID}}</h5>
<span class="badge bg-warning text-dark status-badge">Scheduled</span>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4 mb-3">
2026-01-21 18:26:48 +00:00
<strong><i class="fas fa-sync me-2"></i>Type:</strong>
<span>{{.Report.Type}}</span>
2026-01-09 21:31:45 +00:00
</div>
<div class="col-md-4 mb-3">
2026-01-21 18:26:48 +00:00
<strong><i class="fas fa-calendar-plus me-2"></i>Created:</strong>
<span>{{.Report.Created|timeSince}}</span>
2026-01-09 21:31:45 +00:00
</div>
<div class="col-md-4 mb-3">
<strong><i class="fas fa-hourglass-half me-2"></i>Next Step:</strong>
<span>July 19, 2023 (Estimated)</span>
</div>
2026-01-09 20:08:29 +00:00
</div>
</div>
</div>
2026-01-09 21:31:45 +00:00
<!-- Contact Information -->
<div class="row mb-4">
<div class="col-md-6 mb-3 mb-md-0">
<div class="card h-100">
<div class="card-header bg-secondary text-white">
<h5 class="mb-0"><i class="fas fa-user me-2"></i>Reporter Information</h5>
</div>
<div class="card-body">
2026-01-21 17:51:18 +00:00
<p><strong>Name:</strong>{{.Report.Reporter.Name}}</p>
<p><strong>Phone:</strong>{{.Report.Reporter.Phone}}</p>
<p><strong>Email:</strong>{{.Report.Reporter.Email}}</p>
2026-01-09 21:31:45 +00:00
</div>
2026-01-09 20:08:29 +00:00
</div>
</div>
2026-01-09 21:31:45 +00:00
<div class="col-md-6">
<div class="card h-100">
<div class="card-header bg-secondary text-white">
2026-01-21 17:51:18 +00:00
<h5 class="mb-0"><i class="fas fa-home me-2"></i>Reported Location</h5>
2026-01-09 21:31:45 +00:00
</div>
<div class="card-body">
2026-01-21 17:51:18 +00:00
<p><strong>Site Contact Name:</strong>{{.Report.SiteOwner.Name}}</p>
<p><strong>Site Contact Phone:</strong>{{.Report.SiteOwner.Phone}}</p>
<p><strong>Site Contact Email:</strong>{{.Report.SiteOwner.Email}}</p>
<p><strong>Address:</strong>{{.Report.Address}}</p>
2026-01-09 21:31:45 +00:00
</div>
2026-01-09 20:08:29 +00:00
</div>
</div>
</div>
2026-01-21 18:26:48 +00:00
2026-01-21 17:51:18 +00:00
<!-- Report Information -->
2026-01-21 18:26:48 +00:00
<div class="card mb-4">
2026-01-21 17:51:18 +00:00
<div class="card-header bg-success text-white">
<h5 class="mb-0"><i class="fas fa-history me-2"></i>Report Detail</h5>
</div>
<div class="card-body">
{{ if not (eq .Report.Comments "") }}
<p><strong>Comments:</strong>{{ .Report.Comments }}</p>
{{ end }}
2026-01-21 17:51:18 +00:00
</div>
</div>
2026-01-21 18:26:48 +00:00
2026-01-09 21:31:45 +00:00
<!-- Map Section -->
<div class="card mb-4">
<div class="card-header bg-info text-white">
<h5 class="mb-0"><i class="fas fa-map-marked-alt me-2"></i>Location Map</h5>
</div>
<div class="card-body p-0">
<map-with-markers
2026-01-21 17:51:18 +00:00
api-key="{{ .MapboxToken }}"
zoom="14"/>
2026-01-09 20:08:29 +00:00
</div>
</div>
2026-01-21 18:26:48 +00:00
<div class="card mb-4">
<div class="card-header bg-info text-white">
<h5 class="mb-0"><i class="fas fa-photo me-2"></i>Images</h5>
</div>
<div class="card-body p-0">
{{ if gt (len .Report.Images) 0 }}
{{ range .Report.Images }}
<img src="{{ .URL }}" width="256"/>
{{ end }}
{{ else }}
<p>None</p>
{{ end }}
</div>
</div>
2026-01-09 21:31:45 +00:00
<!-- History Timeline -->
<!--
2026-01-09 21:31:45 +00:00
<div class="card">
<div class="card-header bg-success text-white">
<h5 class="mb-0"><i class="fas fa-history me-2"></i>Request History</h5>
</div>
<div class="card-body">
<div class="timeline">
<div class="timeline-item">
<div class="timeline-date">July 17, 2023 - 2:45 PM</div>
<h5 class="mb-1">Scheduled for Treatment</h5>
<p class="mb-0">Site visit scheduled for July 19. Technician: Michael Johnson</p>
</div>
<div class="timeline-item">
<div class="timeline-date">July 16, 2023 - 10:30 AM</div>
<h5 class="mb-1">Assessment Complete</h5>
<p class="mb-0">Initial assessment completed. Property requires treatment for mosquito larvae.</p>
</div>
<div class="timeline-item">
<div class="timeline-date">July 15, 2023 - 1:15 PM</div>
<h5 class="mb-1">In Review</h5>
<p class="mb-0">Report assigned to field supervisor for initial assessment.</p>
</div>
<div class="timeline-item">
<div class="timeline-date">July 15, 2023 - 9:30 AM</div>
<h5 class="mb-1">Report Created</h5>
<p class="mb-0">New mosquito nuisance report submitted by Jane Doe.</p>
</div>
2026-01-09 20:08:29 +00:00
</div>
</div>
</div>
-->
2026-01-09 20:08:29 +00:00
</div>
{{end}}