|
|
|
@ -147,67 +147,35 @@ func FinalResultsTable(results []models.FinalResult) templ.Component {
|
|
|
|
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 class=\"display-5\"><small>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</td><td class=\"display-5\">")
|
|
|
|
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, 8, ", ")
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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, 10, "DNF")
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
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: 71, Col: 55}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</small></td><td class=\"display-5\">")
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if result.DNF {
|
|
|
|
if result.DNF {
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<span class=\"text-danger\">DNF</span>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<span class=\"text-danger\">DNF</span>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<strong>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<strong>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var10 string
|
|
|
|
var templ_7745c5c3_Var9 string
|
|
|
|
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.3f - %.0f MPH", result.AverageTime, math.Round(416/result.AverageTime/17.6)))
|
|
|
|
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.3f - %.0f MPH", result.AverageTime, math.Round(416/result.AverageTime/17.6)))
|
|
|
|
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: 80, Col: 121}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 80, Col: 121}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
|
|
|
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, 14, "</strong>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</strong>")
|
|
|
|
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, 15, "</td></tr>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</td></tr>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -233,12 +201,12 @@ func FinalResultsPage(groups []models.Group, selectedGroupID int64, results []mo
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
|
|
|
|
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
|
|
|
|
if templ_7745c5c3_Var11 == nil {
|
|
|
|
if templ_7745c5c3_Var10 == nil {
|
|
|
|
templ_7745c5c3_Var11 = templ.NopComponent
|
|
|
|
templ_7745c5c3_Var10 = templ.NopComponent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
|
|
|
if !templ_7745c5c3_IsBuffer {
|
|
|
|
if !templ_7745c5c3_IsBuffer {
|
|
|
|
@ -250,53 +218,53 @@ func FinalResultsPage(groups []models.Group, selectedGroupID int64, results []mo
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<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, 12, "<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 {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _, group := range groups {
|
|
|
|
for _, group := range groups {
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<option value=\"")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<option value=\"")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var13 string
|
|
|
|
var templ_7745c5c3_Var12 string
|
|
|
|
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", group.ID))
|
|
|
|
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", group.ID))
|
|
|
|
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: 106, Col: 54}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 106, Col: 54}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
|
|
|
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, 18, "\"")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\"")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if group.ID == selectedGroupID {
|
|
|
|
if group.ID == selectedGroupID {
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, " selected")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " selected")
|
|
|
|
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, 20, ">")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, ">")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var14 string
|
|
|
|
var templ_7745c5c3_Var13 string
|
|
|
|
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(group.Name)
|
|
|
|
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(group.Name)
|
|
|
|
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: 107, Col: 24}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/final_results_page.templ`, Line: 107, Col: 24}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
|
|
|
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, 21, "</option>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</option>")
|
|
|
|
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, 22, "</select></div></form></div></div></div></div>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</select></div></form></div></div></div></div>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -306,13 +274,13 @@ func FinalResultsPage(groups []models.Group, selectedGroupID int64, results []mo
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</div>")
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</div>")
|
|
|
|
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("Final Results").Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer)
|
|
|
|
templ_7745c5c3_Err = Layout("Final Results").Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|