Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lua/wikis/commons/TeamParticipants/Parse/Wiki.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ function TeamParticipantsWikiParser.parsePlayer(playerInput)
local resultsInput = Logic.readBoolOrNil(playerInput.results)
local roles = RoleUtil.readRoleArgs(playerInput.role)
local playerType = playerInput.type or 'player'
local isFormer = playerType == 'former'

local hasNoStaffRoles = Array.all(roles, function(role) return role.type ~= RoleUtil.ROLE_TYPE.STAFF end)

Expand All @@ -214,6 +215,7 @@ function TeamParticipantsWikiParser.parsePlayer(playerInput)
roles = roles,
trophies = tonumber(playerInput.trophies),
type = playerType,
isFormer = isFormer,
played = Logic.nilOr(playedInput, true),
results = Logic.nilOr(resultsInput, playedInput, true),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function PotentialQualifiers:render()

local children = {
Div{
classes = {'team-participant-card__potential-qualifiers-title'},
classes = {'team-participant-card__subheader'},
children = 'Potential qualifiers'
},
Div{
Expand Down
65 changes: 63 additions & 2 deletions lua/wikis/commons/Widget/Participants/Team/Roster.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
-- @Liquipedia
-- page=Module:Widget/Participants/Team/Roster
Expand Down Expand Up @@ -110,6 +110,62 @@
end
return orderA < orderB
end)

-- Split into former players and former staff
local formerPlayers = Array.filter(players, function(player)
return player.extradata.isFormer and player.extradata.type ~= 'staff'
end)
local formerStaff = Array.filter(players, function(player)
return player.extradata.isFormer and player.extradata.type == 'staff'
end)
Comment on lines +115 to +120
Copy link
Collaborator

@mbergen mbergen Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to avoid doing this for all tabs, and only do it for the former tab


-- If we have former players or staff, render with subheaders
if #formerPlayers > 0 or #formerStaff > 0 then
local function makeRosterSection(sectionPlayers)
return Div{
classes = { 'team-participant-roster' },
children = Array.map(sectionPlayers, function(player, index)
local playerTeam = participant.opponent.template ~= player.team and player.team or nil
local playerTeamAsOpponent = playerTeam and Opponent.readOpponentArgs{
type = Opponent.team,
template = playerTeam,
} or nil
local roleLeft, roleRight = getRoleDisplays(player)
return ParticipantsTeamMember{
player = player,
team = playerTeamAsOpponent,
even = index % 2 == 0,
roleLeft = roleLeft,
roleRight = roleRight,
trophies = player.extradata.trophies or 0,
}
end)
}
end

local children = {}
if #formerPlayers > 0 then
table.insert(children, Div{
classes = {'team-participant-card__subheader'},
children = 'Players'
})
table.insert(children, makeRosterSection(formerPlayers))
end
if #formerStaff > 0 then
table.insert(children, Div{
classes = {'team-participant-card__subheader'},
children = 'Staff'
})
table.insert(children, makeRosterSection(formerStaff))
end

return Div{
classes = { 'team-participant-roster' },
children = children
}
end

-- Otherwise render as a single roster (for non-former tabs)
return Div{
classes = { 'team-participant-roster' },
children = Array.map(players, function(player, index)
Expand All @@ -126,7 +182,6 @@
roleLeft = roleLeft,
roleRight = roleRight,
trophies = player.extradata.trophies or 0,
strikethrough = player.extradata.type == 'former',
}
end)
}
Expand All @@ -136,7 +191,13 @@
local tabTypeEnum, tabData = tabTuple[1], tabTuple[2]
local tabPlayers = Array.filter(participant.opponent.players or {}, function(player)
local personType = player.extradata.type
return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum
if tabTypeEnum == TAB_ENUM.STAFF then
return personType == 'staff'
elseif tabTypeEnum == TAB_ENUM.FORMER then
return player.extradata.isFormer
else
return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum
end
Comment on lines +194 to +200
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if tabTypeEnum == TAB_ENUM.STAFF then
return personType == 'staff'
elseif tabTypeEnum == TAB_ENUM.FORMER then
return player.extradata.isFormer
else
return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum
end
if player.extradata.isFormer then
return tabTypeEnum == TAB_ENUM.former
else
return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum
end

To avoid former staff from appearing in both former and staff while reducing "duplicate" code

end)
return {
order = tabData.order,
Expand Down
28 changes: 14 additions & 14 deletions stylesheets/commons/TeamParticipantCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -427,20 +427,6 @@ $compact-selector: '[data-switch-group="team-cards-compact"]';
flex-direction: column;
gap: 0.25rem;

&-title {
padding: 0 0.5rem;
font-size: 0.875rem;
font-weight: bold;

.theme--light & {
color: var( --clr-secondary-25 );
}

.theme--dark & {
color: var( --clr-secondary-90 );
}
}

&-list {
display: flex;
flex-direction: column;
Expand All @@ -467,6 +453,20 @@ $compact-selector: '[data-switch-group="team-cards-compact"]';
}
}
}

&__subheader {
padding: 0 0.5rem;
font-size: 0.875rem;
font-weight: bold;

.theme--light & {
color: var( --clr-secondary-25 );
}

.theme--dark & {
color: var( --clr-secondary-90 );
}
}
}

body:has( .switch-toggle-active#{ $compact-selector } ) {
Expand Down
Loading