event handling

main
DustyP 9 months ago
parent 809ae7a6f6
commit b450a93724

@ -0,0 +1,20 @@
package templates
templ LayoutPublic(title string) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{ title } - Derby Race Manager</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="/static/js/htmx.min.js"></script>
</head>
<body class="bg-light min-vh-100">
<main>
{ children... }
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
}

@ -0,0 +1,61 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.833
package templates
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func LayoutPublic(title string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/layout_public.templ`, Line: 9, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " - Derby Race Manager</title><link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css\" rel=\"stylesheet\"><script src=\"/static/js/htmx.min.js\"></script></head><body class=\"bg-light min-vh-100\"><main>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</main><script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js\"></script></body></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
var _ = templruntime.GeneratedTemplate

@ -147,6 +147,7 @@ templ RaceManage(groups []models.Group, currentGroup models.Group, heats []model
// WebSocket connections // WebSocket connections
const timerSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/timer`); const timerSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/timer`);
const adminSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/admin`); const adminSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/admin`);
const eventsSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/events`);
const timerDisplay = document.getElementById('timer'); const timerDisplay = document.getElementById('timer');
const statusIndicator = document.getElementById('status-indicator'); const statusIndicator = document.getElementById('status-indicator');
@ -211,6 +212,37 @@ templ RaceManage(groups []models.Group, currentGroup models.Group, heats []model
} }
}; };
// Events socket handling
eventsSocket.onmessage = function(event) {
const data = JSON.parse(event.data);
if (data.event === 'race_start') {
// Race has started
console.log('Race started!');
// Update UI or play sound if needed
} else if (data.event === 'lane_finish') {
// A lane has finished
console.log(`Lane ${data.lane} finished with time ${data.time}`);
// Update the lane time and position in the UI
const laneTimeElement = document.getElementById(`lane-${data.lane}-time`);
if (laneTimeElement) {
laneTimeElement.textContent = data.time.toFixed(3);
}
const lanePositionElement = document.getElementById(`lane-${data.lane}-position`);
if (lanePositionElement) {
lanePositionElement.textContent = data.position;
}
} else if (data.event === 'race_end') {
// Race has ended
console.log('Race ended!');
// Save the heat results
saveHeatResults();
}
};
// Function to reset the timer // Function to reset the timer
function resetTimer() { function resetTimer() {
fetch('/api/timer/reset', { method: 'POST' }) fetch('/api/timer/reset', { method: 'POST' })

File diff suppressed because one or more lines are too long

@ -8,7 +8,7 @@ import (
// RacePublic renders the public race view // RacePublic renders the public race view
templ RacePublic(currentGroup models.Group, heats []models.Heat, racers []models.Racer, currentHeatNum int, results []models.HeatResult) { templ RacePublic(currentGroup models.Group, heats []models.Heat, racers []models.Racer, currentHeatNum int, results []models.HeatResult) {
@Layout("Race - " + currentGroup.Name) { @LayoutPublic("Race - " + currentGroup.Name) {
<div class="container-fluid mt-3"> <div class="container-fluid mt-3">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
@ -109,6 +109,32 @@ templ RacePublic(currentGroup models.Group, heats []models.Heat, racers []models
} }
}; };
// Events WebSocket for race events
const eventsSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/events`);
eventsSocket.onmessage = function(event) {
const data = JSON.parse(event.data);
if (data.event === 'race_start') {
// Race has started
console.log('Race started!');
// You could add visual effects or sounds here
} else if (data.event === 'lane_finish') {
// A lane has finished
console.log(`Lane ${data.lane} finished with time ${data.time}`);
// You could add visual effects or sounds here
} else if (data.event === 'race_end') {
// Race has ended
console.log('Race ended!');
// You could add visual effects or sounds here
// Reload the page after a short delay to show final results
setTimeout(() => {
window.location.reload();
}, 3000);
}
};
// Auto-refresh the page every 30 seconds to keep data current // Auto-refresh the page every 30 seconds to keep data current
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();

@ -125,13 +125,13 @@ func RacePublic(currentGroup models.Group, heats []models.Heat, racers []models.
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</div></div></div></div></div><script>\r\n // WebSocket connection for timer updates\r\n const timerSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/timer`);\r\n const timerDisplay = document.getElementById('timer');\r\n const statusIndicator = document.getElementById('status-indicator');\r\n \r\n timerSocket.onmessage = function(event) {\r\n const data = JSON.parse(event.data);\r\n \r\n if (data.type === 'time') {\r\n timerDisplay.textContent = data.time.toFixed(3);\r\n } else if (data.type === 'status') {\r\n statusIndicator.textContent = data.status;\r\n \r\n // Update status indicator color\r\n statusIndicator.className = 'badge ';\r\n if (data.status === 'Ready') {\r\n statusIndicator.className += 'bg-secondary';\r\n } else if (data.status === 'Running') {\r\n statusIndicator.className += 'bg-success';\r\n } else if (data.status === 'Finished') {\r\n statusIndicator.className += 'bg-primary';\r\n }\r\n } else if (data.type === 'lane-time') {\r\n // Update lane time display\r\n const laneTimeElement = document.getElementById(`lane-${data.lane}-time`);\r\n if (laneTimeElement) {\r\n laneTimeElement.textContent = data.time.toFixed(3);\r\n }\r\n } else if (data.type === 'lane-position') {\r\n // Update lane position display\r\n const lanePositionElement = document.getElementById(`lane-${data.lane}-position`);\r\n if (lanePositionElement) {\r\n lanePositionElement.textContent = data.position;\r\n }\r\n } else if (data.type === 'reload') {\r\n // Reload the page when heat changes\r\n window.location.reload();\r\n }\r\n };\r\n \r\n // Auto-refresh the page every 30 seconds to keep data current\r\n setTimeout(() => {\r\n window.location.reload();\r\n }, 30000);\r\n </script>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</div></div></div></div></div><script>\r\n // WebSocket connection for timer updates\r\n const timerSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/timer`);\r\n const timerDisplay = document.getElementById('timer');\r\n const statusIndicator = document.getElementById('status-indicator');\r\n \r\n timerSocket.onmessage = function(event) {\r\n const data = JSON.parse(event.data);\r\n \r\n if (data.type === 'time') {\r\n timerDisplay.textContent = data.time.toFixed(3);\r\n } else if (data.type === 'status') {\r\n statusIndicator.textContent = data.status;\r\n \r\n // Update status indicator color\r\n statusIndicator.className = 'badge ';\r\n if (data.status === 'Ready') {\r\n statusIndicator.className += 'bg-secondary';\r\n } else if (data.status === 'Running') {\r\n statusIndicator.className += 'bg-success';\r\n } else if (data.status === 'Finished') {\r\n statusIndicator.className += 'bg-primary';\r\n }\r\n } else if (data.type === 'lane-time') {\r\n // Update lane time display\r\n const laneTimeElement = document.getElementById(`lane-${data.lane}-time`);\r\n if (laneTimeElement) {\r\n laneTimeElement.textContent = data.time.toFixed(3);\r\n }\r\n } else if (data.type === 'lane-position') {\r\n // Update lane position display\r\n const lanePositionElement = document.getElementById(`lane-${data.lane}-position`);\r\n if (lanePositionElement) {\r\n lanePositionElement.textContent = data.position;\r\n }\r\n } else if (data.type === 'reload') {\r\n // Reload the page when heat changes\r\n window.location.reload();\r\n }\r\n };\r\n \r\n // Events WebSocket for race events\r\n const eventsSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/events`);\r\n \r\n eventsSocket.onmessage = function(event) {\r\n const data = JSON.parse(event.data);\r\n \r\n if (data.event === 'race_start') {\r\n // Race has started\r\n console.log('Race started!');\r\n // You could add visual effects or sounds here\r\n } else if (data.event === 'lane_finish') {\r\n // A lane has finished\r\n console.log(`Lane ${data.lane} finished with time ${data.time}`);\r\n // You could add visual effects or sounds here\r\n } else if (data.event === 'race_end') {\r\n // Race has ended\r\n console.log('Race ended!');\r\n // You could add visual effects or sounds here\r\n \r\n // Reload the page after a short delay to show final results\r\n setTimeout(() => {\r\n window.location.reload();\r\n }, 3000);\r\n }\r\n };\r\n \r\n // Auto-refresh the page every 30 seconds to keep data current\r\n setTimeout(() => {\r\n window.location.reload();\r\n }, 30000);\r\n </script>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
return nil return nil
}) })
templ_7745c5c3_Err = Layout("Race - "+currentGroup.Name).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) templ_7745c5c3_Err = LayoutPublic("Race - "+currentGroup.Name).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@ -276,7 +276,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var8 string var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(lane)) templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(lane))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 197, Col: 58} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 223, Col: 58}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -289,7 +289,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var9 string var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(racer.FirstName) templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(racer.FirstName)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 200, Col: 56} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 226, Col: 56}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -302,7 +302,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var10 string var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(racer.LastName) templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(racer.LastName)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 200, Col: 75} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 226, Col: 75}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -315,7 +315,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var11 string var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(racer.CarNumber) templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(racer.CarNumber)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 202, Col: 61} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 228, Col: 61}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -328,7 +328,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var12 string var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.1f oz", racer.CarWeight)) templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.1f oz", racer.CarWeight))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 203, Col: 86} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 229, Col: 86}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -341,7 +341,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var13 string var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("lane-%d-time", lane)) templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("lane-%d-time", lane))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 210, Col: 75} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 236, Col: 75}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -355,7 +355,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var14 string var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.3f", time)) templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.3f", time))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 212, Col: 67} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 238, Col: 67}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -374,7 +374,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var15 string var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("lane-%d-position", lane)) templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("lane-%d-position", lane))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 222, Col: 79} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 248, Col: 79}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -388,7 +388,7 @@ func raceLaneCard(lane int, racerID int64, racers []models.Racer, result *models
var templ_7745c5c3_Var16 string var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(position)) templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(position))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 224, Col: 64} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 250, Col: 64}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -446,7 +446,7 @@ func raceNextHeatPreview(heats []models.Heat, racers []models.Racer, heatNum int
var templ_7745c5c3_Var18 string var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(heatNum)) templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(heatNum))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 251, Col: 49} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 277, Col: 49}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -526,7 +526,7 @@ func raceNextHeatRow(lane int, racerID int64, racers []models.Racer) templ.Compo
var templ_7745c5c3_Var20 string var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(lane)) templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(lane))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 293, Col: 32} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 319, Col: 32}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -539,7 +539,7 @@ func raceNextHeatRow(lane int, racerID int64, racers []models.Racer) templ.Compo
var templ_7745c5c3_Var21 string var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(racer.FirstName) templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(racer.FirstName)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 294, Col: 29} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 320, Col: 29}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -552,7 +552,7 @@ func raceNextHeatRow(lane int, racerID int64, racers []models.Racer) templ.Compo
var templ_7745c5c3_Var22 string var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(racer.LastName) templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(racer.LastName)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 294, Col: 48} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 320, Col: 48}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -565,7 +565,7 @@ func raceNextHeatRow(lane int, racerID int64, racers []models.Racer) templ.Compo
var templ_7745c5c3_Var23 string var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(racer.CarNumber) templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(racer.CarNumber)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 295, Col: 29} return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/race_public.templ`, Line: 321, Col: 29}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

Loading…
Cancel
Save