|
|
|
@ -46,20 +46,20 @@ func FinalResultsPublic(results []models.FinalResult, groupName string, revealCo
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"container mt-4\"><div class=\"text-center mb-5\"><h1 class=\"display-4\">Final Results</h1><h2 class=\"text-primary\" hx-ext=\"sse\" sse-connect=\"/api/admin/events\" sse-swap=\"group-name\">")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"container mt-2\"><div class=\"text-center mb-2\"><h1 class=\"display-3\">Final Results</h1><h2 class=\"text-primary display-4\" hx-ext=\"sse\" sse-connect=\"/api/admin/events\" sse-swap=\"group-name\">")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var3 string
|
|
|
|
var templ_7745c5c3_Var3 string
|
|
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(groupName)
|
|
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(groupName)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 13, Col: 107}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 13, Col: 117}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</h2></div><div class=\"card\"><div class=\"card-header bg-primary text-white\"><h3 class=\"mb-0\">Final Standings</h3></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-striped table-hover\"><thead><tr><th>Place</th><th>Racer</th><th>Car #</th><th>Times</th><th>Final Time</th></tr></thead> <tbody id=\"results-body\" hx-ext=\"sse\" sse-connect=\"/api/admin/events\" sse-swap=\"results-reveal\"></tbody></table></div></div><div class=\"card-footer\"><small class=\"text-muted\">Final time is the average of the fastest 3 times (discarding the slowest time if 4 runs completed)</small></div></div></div><style>\r\n\t\t\t.reveal-animation {\r\n\t\t\t\tanimation: fadeIn 1s;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@keyframes fadeIn {\r\n\t\t\t\tfrom { opacity: 0; transform: translateY(20px); }\r\n\t\t\t\tto { opacity: 1; transform: translateY(0); }\r\n\t\t\t}\r\n\t\t</style>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</h2></div><div class=\"card\"><div class=\"card-header bg-primary text-white\"><h3 class=\"mb-0 display-3\">Final Standings</h3></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-striped table-hover\"><thead><tr><th class=\"display-3\">Place</th><th class=\"display-3\">Racer</th><th class=\"display-3\">Car #</th><th class=\"display-3\">Times</th><th class=\"display-3\">Final Time</th></tr></thead> <tbody id=\"results-body\" hx-ext=\"sse\" sse-connect=\"/api/admin/events\" sse-swap=\"results-reveal\"></tbody></table></div></div><div class=\"card-footer\"><small class=\"text-muted\">Final time is the average of the fastest 3 times (discarding the slowest time if 4 runs completed)</small></div></div></div><style>\r\n\t\t\t.reveal-animation {\r\n\t\t\t\tanimation: fadeIn 1s;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@keyframes fadeIn {\r\n\t\t\t\tfrom { opacity: 0; transform: translateY(20px); }\r\n\t\t\t\tto { opacity: 1; transform: translateY(0); }\r\n\t\t\t}\r\n\t\t</style>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -95,27 +95,27 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
for _, result := range results {
|
|
|
|
for _, result := range results {
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<tr class=\"reveal-animation\"><td>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<tr class=\"reveal-animation\"><td class=\"display-3\">")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var5 string
|
|
|
|
var templ_7745c5c3_Var5 string
|
|
|
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", result.Place))
|
|
|
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", result.Place))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 59, Col: 49}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 59, Col: 67}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</td><td>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</td><td class=\"display-3\">")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var6 string
|
|
|
|
var templ_7745c5c3_Var6 string
|
|
|
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(result.Racer.FirstName)
|
|
|
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(result.Racer.FirstName)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 60, Col: 40}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 60, Col: 58}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
@ -128,26 +128,26 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
|
|
|
|
var templ_7745c5c3_Var7 string
|
|
|
|
var templ_7745c5c3_Var7 string
|
|
|
|
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(result.Racer.LastName)
|
|
|
|
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(result.Racer.LastName)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 60, Col: 66}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 60, Col: 84}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</td><td>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</td><td class=\"display-3\">")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var8 string
|
|
|
|
var templ_7745c5c3_Var8 string
|
|
|
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(result.Racer.CarNumber)
|
|
|
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(result.Racer.CarNumber)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 61, Col: 40}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 61, 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 {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</td><td><small>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</td><td class=\"display-3\"><small>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -179,7 +179,7 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</small></td><td>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</small></td><td class=\"display-3\">")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|