added free agents
This commit is contained in:
@@ -8,6 +8,7 @@ templ FixtureReviewResultPage(
|
||||
fixture *db.Fixture,
|
||||
result *db.FixtureResult,
|
||||
unmappedPlayers []string,
|
||||
unnominatedFreeAgents []FreeAgentWarning,
|
||||
) {
|
||||
{{
|
||||
backURL := fmt.Sprintf("/fixtures/%d", fixture.ID)
|
||||
@@ -37,38 +38,56 @@ templ FixtureReviewResultPage(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Warnings Section -->
|
||||
if result.TamperingDetected || len(unmappedPlayers) > 0 {
|
||||
<div class="space-y-4 mb-6">
|
||||
if result.TamperingDetected && result.TamperingReason != nil {
|
||||
<div class="bg-red/10 border border-red/30 rounded-lg p-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<!-- Warnings Section -->
|
||||
if result.TamperingDetected || len(unmappedPlayers) > 0 || len(unnominatedFreeAgents) > 0 {
|
||||
<div class="space-y-4 mb-6">
|
||||
if result.TamperingDetected && result.TamperingReason != nil {
|
||||
<div class="bg-red/10 border border-red/30 rounded-lg p-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<span class="text-red font-bold text-sm">⚠ Inconsistent Data Detected</span>
|
||||
</div>
|
||||
<p class="text-red/80 text-sm">{ *result.TamperingReason }</p>
|
||||
<p class="text-red/60 text-xs mt-2">
|
||||
This does not block finalization but should be reviewed carefully.
|
||||
</p>
|
||||
<p class="text-red/80 text-sm">{ *result.TamperingReason }</p>
|
||||
<p class="text-red/60 text-xs mt-2">
|
||||
This does not block finalization but should be reviewed carefully.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
if len(unnominatedFreeAgents) > 0 {
|
||||
<div class="bg-yellow/10 border border-yellow/30 rounded-lg p-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<span class="text-yellow font-bold text-sm">⚠ Free Agent Nomination Issues</span>
|
||||
</div>
|
||||
}
|
||||
if len(unmappedPlayers) > 0 {
|
||||
<div class="bg-yellow/10 border border-yellow/30 rounded-lg p-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<span class="text-yellow font-bold text-sm">⚠ Unmapped Players</span>
|
||||
</div>
|
||||
<p class="text-yellow/80 text-sm mb-2">
|
||||
The following players could not be matched to registered players.
|
||||
They may be free agents or have unregistered Slapshot IDs.
|
||||
</p>
|
||||
<ul class="list-disc list-inside text-yellow/70 text-xs space-y-0.5">
|
||||
for _, p := range unmappedPlayers {
|
||||
<li>{ p }</li>
|
||||
}
|
||||
</ul>
|
||||
<p class="text-yellow/80 text-sm mb-2">
|
||||
The following free agents have nomination issues that should be reviewed before finalizing.
|
||||
</p>
|
||||
<ul class="list-disc list-inside text-yellow/70 text-xs space-y-0.5">
|
||||
for _, fa := range unnominatedFreeAgents {
|
||||
<li>
|
||||
<span class="text-yellow font-medium">{ fa.Name }</span>
|
||||
<span class="text-yellow/60"> — { fa.Reason }</span>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
if len(unmappedPlayers) > 0 {
|
||||
<div class="bg-yellow/10 border border-yellow/30 rounded-lg p-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<span class="text-yellow font-bold text-sm">⚠ Unmapped Players</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<p class="text-yellow/80 text-sm mb-2">
|
||||
The following players could not be matched to registered players.
|
||||
They may be free agents or have unregistered Slapshot IDs.
|
||||
</p>
|
||||
<ul class="list-disc list-inside text-yellow/70 text-xs space-y-0.5">
|
||||
for _, p := range unmappedPlayers {
|
||||
<li>{ p }</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<!-- Score Overview -->
|
||||
<div class="bg-mantle border border-surface1 rounded-lg overflow-hidden mb-6">
|
||||
<div class="bg-surface0 border-b border-surface1 px-4 py-3">
|
||||
@@ -199,10 +218,17 @@ templ reviewTeamStats(team *db.Team, result *db.FixtureResult, side string) {
|
||||
for _, ps := range finalStats {
|
||||
<tr class="hover:bg-surface0 transition-colors">
|
||||
<td class="px-3 py-2 text-sm text-text">
|
||||
{ ps.Username }
|
||||
if ps.PlayerID == nil {
|
||||
<span class="text-yellow text-xs ml-1" title="Unmapped player">?</span>
|
||||
}
|
||||
<span class="flex items-center gap-1.5">
|
||||
{ ps.Username }
|
||||
if ps.PlayerID == nil {
|
||||
<span class="text-yellow text-xs" title="Unmapped player">?</span>
|
||||
}
|
||||
if ps.Stats.IsFreeAgent {
|
||||
<span class="px-1.5 py-0.5 bg-peach/20 text-peach rounded text-xs font-medium">
|
||||
FREE AGENT
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-2 py-2 text-center text-sm text-text">{ intPtrStr(ps.Stats.Goals) }</td>
|
||||
<td class="px-2 py-2 text-center text-sm text-text">{ intPtrStr(ps.Stats.Assists) }</td>
|
||||
|
||||
Reference in New Issue
Block a user