DustyP 9 months ago
parent 30817c39c6
commit e87c8ee1bb

@ -22,11 +22,11 @@ templ FinalResultsPublic(results []models.FinalResult, groupName string, revealC
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th class="display-3">Place</th> <th class="display-5">Place</th>
<th class="display-3">Racer</th> <th class="display-5">Racer</th>
<th class="display-3">Car #</th> <th class="display-5">Car #</th>
<th class="display-3">Times</th> <th class="display-5">Times</th>
<th class="display-3">Final Time</th> <th class="display-5">Final Time</th>
</tr> </tr>
</thead> </thead>
<tbody id="results-body" hx-ext="sse" sse-connect="/api/admin/events" sse-swap="results-reveal"> <tbody id="results-body" hx-ext="sse" sse-connect="/api/admin/events" sse-swap="results-reveal">
@ -56,10 +56,10 @@ templ FinalResultsPublic(results []models.FinalResult, groupName string, revealC
templ FinalResultsTable(results []models.FinalResult) { templ FinalResultsTable(results []models.FinalResult) {
for _, result := range results { for _, result := range results {
<tr class="reveal-animation"> <tr class="reveal-animation">
<td class="display-3">{ fmt.Sprintf("%d", result.Place) }</td> <td class="display-5">{ fmt.Sprintf("%d", result.Place) }</td>
<td class="display-3">{ result.Racer.FirstName } { result.Racer.LastName }</td> <td class="display-5">{ result.Racer.FirstName } { result.Racer.LastName }</td>
<td class="display-3">{ result.Racer.CarNumber }</td> <td class="display-5">{ result.Racer.CarNumber }</td>
<td class="display-3"> <td class="display-5">
<small> <small>
for i, time := range result.Times { for i, time := range result.Times {
if i > 0 { if i > 0 {
@ -73,7 +73,7 @@ templ FinalResultsTable(results []models.FinalResult) {
} }
</small> </small>
</td> </td>
<td class="display-3"> <td class="display-5">
if result.DNF { if result.DNF {
<span class="text-danger">DNF</span> <span class="text-danger">DNF</span>
} else { } else {

@ -59,7 +59,7 @@ func FinalResultsPublic(results []models.FinalResult, groupName string, revealCo
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 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>") 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-5\">Place</th><th class=\"display-5\">Racer</th><th class=\"display-5\">Car #</th><th class=\"display-5\">Times</th><th class=\"display-5\">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,7 +95,7 @@ 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 class=\"display-3\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<tr class=\"reveal-animation\"><td class=\"display-5\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@ -108,7 +108,7 @@ 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, 4, "</td><td class=\"display-3\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</td><td class=\"display-5\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@ -134,7 +134,7 @@ 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, 6, "</td><td class=\"display-3\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</td><td class=\"display-5\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@ -147,7 +147,7 @@ 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-3\"><small>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</td><td class=\"display-5\"><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 class=\"display-3\">") 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
} }

Loading…
Cancel
Save