@ -45,28 +45,20 @@ func FinalResultsPublic(results []models.FinalResult, groupName string, revealCo
} ( )
}
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\" >")
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\" >")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3 , templ_7745c5c3_Err = templ . JoinStringErrs ( groupName )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 12 , Col : 40 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 12 , Col : 107 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var3 ) )
if templ_7745c5c3_Err != nil {
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\">" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = FinalResultsTable ( results ) . Render ( ctx , templ_7745c5c3_Buffer )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 3 , "</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\">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>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -102,75 +94,75 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
}
ctx = templ . ClearChildren ( ctx )
for _ , result := range results {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 4 , "<tr class=\"reveal-animation\"><td>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 3 , "<tr class=\"reveal-animation\"><td>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5 , templ_7745c5c3_Err = templ . JoinStringErrs ( fmt . Sprintf ( "%d" , result . Place ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 5 9 , Col : 49 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 5 8 , Col : 49 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var5 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 5 , "</td><td>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 4 , "</td><td>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6 , templ_7745c5c3_Err = templ . JoinStringErrs ( result . Racer . FirstName )
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 : 59 , Col : 40 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var6 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 6 , " " )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 5 , " " )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7 , templ_7745c5c3_Err = templ . JoinStringErrs ( result . Racer . LastName )
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 : 59 , Col : 66 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var7 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 7 , "</td><td>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 6 , "</td><td>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8 , templ_7745c5c3_Err = templ . JoinStringErrs ( result . Racer . CarNumber )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 6 1 , Col : 40 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 6 0 , Col : 40 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var8 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 8 , "</td><td><small>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 7 , "</td><td><small>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i , time := range result . Times {
if i > 0 {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 9 , ", " )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 8 , ", " )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 10 , " " )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 9 , " " )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if time >= 9.999 {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 1 , "DNF" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 0 , "DNF" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -178,7 +170,7 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9 , templ_7745c5c3_Err = templ . JoinStringErrs ( fmt . Sprintf ( "%.3f" , time ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 7 1 , Col : 55 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 7 0 , Col : 55 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var9 ) )
if templ_7745c5c3_Err != nil {
@ -186,35 +178,35 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
}
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 2 , "</small></td><td>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 1 , "</small></td><td>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if result . DNF {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 3 , "<span class=\"text-danger\">DNF</span>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 2 , "<span class=\"text-danger\">DNF</span>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 4 , "<strong>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 3 , "<strong>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10 , templ_7745c5c3_Err = templ . JoinStringErrs ( fmt . Sprintf ( "%.3f" , result . AverageTime ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 80 , Col : 69 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 79 , Col : 69 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var10 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 5 , "</strong>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 4 , "</strong>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 6 , "</td></tr>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 5 , "</td></tr>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -257,53 +249,53 @@ func FinalResultsPage(groups []models.Group, selectedGroupID int64, results []mo
} ( )
}
ctx = templ . InitializeContext ( ctx )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 7 , "<div class=\"container mt-4\"><h1 class=\"mb-4\">Final Results</h1><div class=\"row mb-4\"><div class=\"col-md-6\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Select Group</h5></div><div class=\"card-body\"><form id=\"group-select-form\" method=\"get\" action=\"/results\"><div class=\"mb-3\"><label for=\"group_id\" class=\"form-label\">Racing Group</label> <select class=\"form-select\" id=\"group_id\" name=\"group_id\" onchange=\"this.form.submit()\"><option value=\"\">Select a group...</option> " )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 6 , "<div class=\"container mt-4\"><h1 class=\"mb-4\">Final Results</h1><div class=\"row mb-4\"><div class=\"col-md-6\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Select Group</h5></div><div class=\"card-body\"><form id=\"group-select-form\" method=\"get\" action=\"/results\"><div class=\"mb-3\"><label for=\"group_id\" class=\"form-label\">Racing Group</label> <select class=\"form-select\" id=\"group_id\" name=\"group_id\" onchange=\"this.form.submit()\"><option value=\"\">Select a group...</option> " )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _ , group := range groups {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 8 , "<option value=\"" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 7 , "<option value=\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13 , templ_7745c5c3_Err = templ . JoinStringErrs ( fmt . Sprintf ( "%d" , group . ID ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 10 6 , Col : 54 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 10 5 , Col : 54 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var13 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 9 , "\"" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 8 , "\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if group . ID == selectedGroupID {
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 20 , " selected" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 19 , " selected" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 1 , ">" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 0 , ">" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14 , templ_7745c5c3_Err = templ . JoinStringErrs ( group . Name )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 10 7 , Col : 24 }
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` web/templates/final_results_page.templ ` , Line : 10 6 , Col : 24 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var14 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 2 , "</option>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 1 , "</option>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 3 , "</select></div></form></div></div></div></div>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 2 , "</select></div></form></div></div></div></div>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -313,7 +305,7 @@ func FinalResultsPage(groups []models.Group, selectedGroupID int64, results []mo
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 4 , "</div>" )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 3 , "</div>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}