nidus-sync/public-report/template/status-by-id.html
Eli Ribble 61d8d14fc2
Bunch of work around assigning reports to districts
I added some DB schema to track logos and to relate reports to
organizations. I reworked how GPS data comes from EXIF data on images
because it wasn't working for JPEGs. I might have broken PNGs in the
process. Also made the config options for domain names more
standardized.
2026-01-22 03:27:32 +00:00

193 lines
5.4 KiB
HTML

{{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>
<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, "#00FF00");
GEOJSON_IMAGE_LOCATIONS.forEach((image) => {
map.addMarker(image.coordinates, "#FF0000");
});
});
}
document.addEventListener("DOMContentLoaded", onLoad);
</script>
{{end}}
{{define "content"}}
<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">
<strong><i class="fas fa-sync me-2"></i>Type:</strong>
<span>{{.Report.Type}}</span>
</div>
<div class="col-md-4 mb-3">
<strong><i class="fas fa-calendar-plus me-2"></i>Created:</strong>
<span>{{.Report.Created|timeSince}}</span>
</div>
<div class="col-md-4 mb-3">
<strong><i class="fas fa-hourglass-half me-2"></i>District:</strong>
<span>{{.Report.District}}</span>
</div>
</div>
</div>
</div>
<!-- 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">
<p><strong>Name:</strong>{{.Report.Reporter.Name}}</p>
<p><strong>Phone:</strong>{{.Report.Reporter.Phone}}</p>
<p><strong>Email:</strong>{{.Report.Reporter.Email}}</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card h-100">
<div class="card-header bg-secondary text-white">
<h5 class="mb-0"><i class="fas fa-home me-2"></i>Reported Location</h5>
</div>
<div class="card-body">
<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>
</div>
</div>
</div>
</div>
<!-- Report Information -->
<div class="card mb-4">
<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 }}
</div>
</div>
<!-- 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
api-key="{{ .MapboxToken }}"
zoom="14"/>
</div>
</div>
<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>
<!-- History Timeline -->
<!--
<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>
</div>
</div>
</div>
-->
</div>
{{end}}