Add initial report outline page.

This commit is contained in:
Eli Ribble 2025-11-05 21:05:10 +00:00
parent ac736cced1
commit f6acb6ab83
No known key found for this signature in database
4 changed files with 284 additions and 0 deletions

View file

@ -12,6 +12,14 @@ func getFavicon(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "static/favicon.ico")
}
func getReport(w http.ResponseWriter, r *http.Request) {
//org := r.URL.Query().Get("org")
err := htmlReport(w)
if err != nil {
respondError(w, "Failed to generate report page", err, http.StatusInternalServerError)
}
}
func getRoot(w http.ResponseWriter, r *http.Request) {
user, err := getAuthenticatedUser(r)
if err != nil && !errors.Is(err, &NoCredentialsError{}) {

View file

@ -15,6 +15,7 @@ import (
var (
dashboard = newBuiltTemplate("dashboard", "authenticated")
report = newBuiltTemplate("report", "base")
signin = newBuiltTemplate("signin", "base")
signup = newBuiltTemplate("signup", "base")
)
@ -32,6 +33,8 @@ type Link struct {
type ContentDashboard struct {
User User
}
type ContentPlaceholder struct {
}
type ContentSignin struct {
InvalidCredentials bool
}
@ -83,6 +86,11 @@ func htmlDashboard(w io.Writer, user *models.User) error {
return dashboard.ExecuteTemplate(w, data)
}
func htmlReport(w io.Writer) error {
data := ContentPlaceholder{}
return report.ExecuteTemplate(w, data)
}
func htmlSignin(w io.Writer, errorCode string) error {
data := ContentSignin{
InvalidCredentials: errorCode == "invalid-credentials",

View file

@ -58,6 +58,7 @@ func main() {
r.Use(sessionManager.LoadAndSave)
r.Get("/", getRoot)
r.Get("/report", getReport)
r.Post("/signin", postSignin)
r.Get("/signup", getSignup)
r.Post("/signup", postSignup)

267
templates/report.html Normal file
View file

@ -0,0 +1,267 @@
{{template "base.html" .}}
{{define "title"}}Login{{end}}
{{define "style"}}
.entry-container {
max-width: 1000px;
margin: 0 auto;
}
.entry-box {
box-shadow: 0 0 15px rgba(0,0,0,0.1);
border-radius: 10px;
padding: 40px;
background-color: #fff;
margin-bottom: 30px;
}
.entry-header {
margin-bottom: 25px;
text-align: center;
}
.logo-area {
text-align: center;
margin-bottom: 30px;
}
.logo-placeholder {
width: 120px;
height: 60px;
background-color: #e9ecef;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
}
.method-section {
margin-bottom: 40px;
padding: 25px;
border-radius: 10px;
background-color: #f8f9fa;
}
.method-title {
margin-bottom: 20px;
display: flex;
align-items: center;
}
.method-title i {
font-size: 1.5rem;
margin-right: 10px;
}
.sms-mockup {
max-width: 300px;
background-color: #dcf8c6;
border-radius: 15px;
padding: 15px;
position: relative;
margin: 20px auto;
}
.qr-code-placeholder {
width: 200px;
height: 200px;
background-color: #e9ecef;
margin: 20px auto;
display: flex;
align-items: center;
justify-content: center;
border: 1px dashed #ced4da;
}
.email-mockup {
max-width: 550px;
background-color: white;
border: 1px solid #ddd;
border-radius: 10px;
padding: 20px;
margin: 20px auto;
}
.email-header {
border-bottom: 1px solid #eee;
padding-bottom: 10px;
margin-bottom: 15px;
}
.door-hanger {
max-width: 300px;
background-color: #fff;
border: 2px solid #dc3545;
border-radius: 10px;
padding: 15px;
position: relative;
margin: 20px auto;
text-align: center;
}
.door-hanger:before {
content: "";
position: absolute;
top: -25px;
left: 50%;
transform: translateX(-50%);
width: 40px;
height: 25px;
background-color: #fff;
border: 2px solid #dc3545;
border-bottom: none;
border-radius: 20px 20px 0 0;
}
{{end}}
{{define "content"}}
<header class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
<div class="container">
<!-- Logo -->
<a class="navbar-brand" href="#">
<div class="logo-placeholder" style="width: 100px; height: 40px; background-color: #e9ecef; display: flex; align-items: center; justify-content: center; border-radius: 4px;">
<span class="text-muted small">Your Logo</span>
</div>
</a>
<!-- Toggle Button for Mobile -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Nav Items -->
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link active" href="#">Diagnostics</a>
</li>
</ul>
<!-- User Info & Logout -->
<div class="d-flex align-items-center">
<div class="dropdown">
<a class="text-decoration-none dropdown-toggle d-flex align-items-center" href="#" role="button" id="userDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<div class="avatar me-2 bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 36px; height: 36px;">
<span class="text-white">JD</span>
</div>
<span class="me-2">John Doe</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
<li><a class="dropdown-item" href="#">Profile</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="#">Logout</a></li>
</ul>
</div>
</div>
</div>
</div>
</header>
<div class="container py-5">
<div class="entry-container">
<div class="entry-box">
<div class="entry-header">
<h1>Green Pool Reporting</h1>
<p class="text-muted">Entry Points Diagnostic Page</p>
</div>
<div class="alert alert-info">
<i class="bi bi-info-circle me-2"></i>
This page demonstrates the various ways customers can access the Green Pool Reporting system.
</div>
<!-- SMS Entry Point -->
<div class="method-section">
<div class="method-title">
<i class="bi bi-chat-dots-fill text-primary"></i>
<h3>Text Message Entry Point</h3>
</div>
<p>Customers will receive the following text message with a link to begin the reporting process:</p>
<div class="sms-mockup">
<strong>Vector Control:</strong> We noticed a potential green pool at your property. Please tap the link to report status or schedule inspection: <a href="#">https://greenpool.county.gov/report/t78fd3</a>
</div>
<div class="mt-3">
<p><strong>SMS Details:</strong></p>
<ul>
<li>Sent via automated system after aerial detection</li>
<li>Contains unique tracking link for each property</li>
<li>Customers tap link to open mobile browser</li>
</ul>
</div>
</div>
<!-- Door Hanger Entry Point -->
<div class="method-section">
<div class="method-title">
<i class="bi bi-qr-code text-success"></i>
<h3>Door Hanger QR Code Entry Point</h3>
</div>
<p>Inspectors will leave door hangers with a QR code for properties where no one is home:</p>
<div class="door-hanger">
<h5>IMPORTANT NOTICE</h5>
<p>We visited regarding a potential mosquito breeding site.</p>
<div class="qr-code-placeholder">
<span>QR Code Image</span>
</div>
<p><strong>Scan this code</strong> with your phone camera to report your pool status or schedule an inspection.</p>
<p class="small text-muted">Or visit: greenpool.county.gov/report</p>
</div>
<div class="mt-3">
<p><strong>Door Hanger Details:</strong></p>
<ul>
<li>Physical notices left on the door handle</li>
<li>QR code contains property-specific link</li>
<li>Fallback URL provided for manual entry</li>
</ul>
</div>
</div>
<!-- Email Entry Point -->
<div class="method-section">
<div class="method-title">
<i class="bi bi-envelope-fill text-danger"></i>
<h3>Email Notification Entry Point</h3>
</div>
<p>Property owners will receive this email as a follow-up to other communication attempts:</p>
<div class="email-mockup">
<div class="email-header">
<strong>From:</strong> Green Pool Response Team &lt;noreply@vectorcontrol.county.gov&gt;<br>
<strong>To:</strong> Property Owner &lt;resident@example.com&gt;<br>
<strong>Subject:</strong> Action Required: Green Pool Detected at Your Property
</div>
<div class="email-body">
<p>Dear Property Owner,</p>
<p>Our recent surveillance has identified a potential unmaintained swimming pool at your property located at <strong>123 Main Street</strong>. Untreated pools can become mosquito breeding grounds and pose public health risks, including the spread of West Nile virus and other diseases.</p>
<div class="text-center my-4">
<a href="#" class="btn btn-primary">Report Pool Status or Schedule Inspection</a>
</div>
<p>Please click the button above or visit <a href="#">https://greenpool.county.gov/report/em29x7</a> to complete a brief questionnaire about your pool status. This will help us determine if an inspection is needed or if you've already addressed the issue.</p>
<p>Thank you for helping keep our community safe and healthy.</p>
<p>Sincerely,<br>
Vector Control Department<br>
County Health Services</p>
</div>
</div>
<div class="mt-3">
<p><strong>Email Details:</strong></p>
<ul>
<li>Sent as follow-up or for property owners with registered email addresses</li>
<li>Contains clear call-to-action button and alternative text link</li>
<li>Explains reason for contact and next steps</li>
</ul>
</div>
</div>
<div class="d-flex justify-content-between mt-4">
<a href="#" class="btn btn-outline-primary">Back to Dashboard</a>
<a href="#" class="btn btn-success">Test Reporting Flow</a>
</div>
</div>
</div>
</div>
{{end}}