Merge remote-tracking branch 'origin/codex/match-detail-scoreboard-and-player-links'

This commit is contained in:
devRaGonSa
2026-05-21 10:31:04 +02:00
11 changed files with 338 additions and 5 deletions

View File

@@ -490,6 +490,7 @@ function renderPlayerStatsPanel(player, item, context) {
${renderPlayerStatChip("KPM", context.kpm)}
</div>
</div>
${renderExternalProfilesSection(player)}
${
hasExpandedStats
? `
@@ -506,6 +507,39 @@ function renderPlayerStatsPanel(player, item, context) {
`;
}
function renderExternalProfilesSection(player) {
const links = [
["steam", "Steam"],
["hellor", "Hellor"],
["hll_records", "HLL Records"],
]
.map(([key, label]) => [label, player.external_profile_links?.[key]])
.filter(([, href]) => typeof href === "string" && href.trim());
return `
<article class="historical-player-stats-panel__section historical-player-stats-panel__profiles">
<h5>Perfiles externos</h5>
${
links.length
? `
<div class="historical-player-profile-links">
${links
.map(
([label, href]) => `
<a href="${escapeHtml(href)}" target="_blank" rel="noopener noreferrer">
${escapeHtml(label)}
</a>
`,
)
.join("")}
</div>
`
: "<p>Perfiles externos no disponibles.</p>"
}
</article>
`;
}
function renderPlayerStatChip(label, value) {
return `
<article>
@@ -620,6 +654,7 @@ function renderActions(item, actionsNode) {
actionsNode.innerHTML = `
<a
class="historical-match-card__link"
data-match-detail-scoreboard-link
href="${escapeHtml(matchUrl)}"
target="_blank"
rel="noopener noreferrer"