added better links to teams and players
This commit is contained in:
@@ -4,6 +4,7 @@ import "git.haelnorr.com/h/oslstats/internal/db"
|
||||
import "git.haelnorr.com/h/oslstats/internal/permissions"
|
||||
import "git.haelnorr.com/h/oslstats/internal/contexts"
|
||||
import "git.haelnorr.com/h/oslstats/internal/view/baseview"
|
||||
import "git.haelnorr.com/h/oslstats/internal/view/component/links"
|
||||
import "fmt"
|
||||
import "sort"
|
||||
import "time"
|
||||
@@ -154,7 +155,9 @@ templ TeamRosterSection(twr *db.TeamWithRoster, available []*db.Player) {
|
||||
<div class="bg-surface0 border border-surface1 rounded-lg overflow-hidden divide-y divide-surface1">
|
||||
if twr.Manager != nil {
|
||||
<div class="px-4 py-3 flex items-center justify-between">
|
||||
<span class="text-text font-medium">{ twr.Manager.Name }</span>
|
||||
<span class="font-medium">
|
||||
@links.PlayerLink(twr.Manager)
|
||||
</span>
|
||||
<span class="text-xs px-2 py-0.5 bg-yellow/20 text-yellow rounded font-medium">
|
||||
★ Manager
|
||||
</span>
|
||||
@@ -162,7 +165,7 @@ templ TeamRosterSection(twr *db.TeamWithRoster, available []*db.Player) {
|
||||
}
|
||||
for _, player := range rosterPlayers {
|
||||
<div class="px-4 py-3">
|
||||
<span class="text-text">{ player.Name }</span>
|
||||
@links.PlayerLink(player)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -680,7 +683,9 @@ templ playerStatsSection(playerStats []*db.AggregatedPlayerStats) {
|
||||
<tbody class="divide-y divide-surface1">
|
||||
for _, ps := range playerStats {
|
||||
<tr class="hover:bg-surface1 transition-colors">
|
||||
<td class="px-3 py-2 text-sm text-text">{ ps.PlayerName }</td>
|
||||
<td class="px-3 py-2 text-sm">
|
||||
@links.PlayerLinkFromStats(ps.PlayerID, ps.PlayerName)
|
||||
</td>
|
||||
<td class="px-2 py-2 text-center text-sm text-subtext0">{ fmt.Sprint(ps.GamesPlayed) }</td>
|
||||
<td class="px-2 py-2 text-center text-sm text-subtext0">{ fmt.Sprint(ps.PeriodsPlayed) }</td>
|
||||
<td class="px-2 py-2 text-center text-sm font-medium text-text">{ fmt.Sprint(ps.Score) }</td>
|
||||
|
||||
Reference in New Issue
Block a user