From b22f09b5eeac6ebcb2bb9722f6572b21235ea0d3 Mon Sep 17 00:00:00 2001 From: SobakaPirat Date: Thu, 26 Feb 2026 01:22:03 +0300 Subject: [PATCH 1/3] Add handling for partyTypes --- lua/wikis/commons/AutomaticPointsTable.lua | 31 ++++++++++++------- .../commons/Widget/AutomaticPointsTable.lua | 4 +-- stylesheets/commons/AutomaticPointsTable.scss | 2 +- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/lua/wikis/commons/AutomaticPointsTable.lua b/lua/wikis/commons/AutomaticPointsTable.lua index e299f795023..635518a1fad 100644 --- a/lua/wikis/commons/AutomaticPointsTable.lua +++ b/lua/wikis/commons/AutomaticPointsTable.lua @@ -155,9 +155,10 @@ function AutomaticPointsTable:parseOpponents(args, tournaments) background = parsedArgs.bg, note = parsedArgs.note, } - assert(parsedOpponent.opponent.type == Opponent.team) assert(not Opponent.isTbd(parsedOpponent.opponent)) local aliases = self:parseAliases(parsedArgs, parsedOpponent.opponent, #tournaments) + local resolveDate = DateExt.readTimestamp(args.date) or DateExt.getContextualDateOrNow() + parsedOpponent.opponent = Opponent.resolve(parsedOpponent.opponent, resolveDate, {syncPlayer = true}) parsedOpponent.results = Array.map(tournaments, function (tournament, tournamentIndex) local manualPoints = parsedArgs['points' .. tournamentIndex] @@ -172,7 +173,7 @@ function AutomaticPointsTable:parseOpponents(args, tournaments) }, self:parseDeduction(parsedArgs, tournament, tournamentIndex)) end - local queriedPoints = self:queryPlacement(aliases[tournamentIndex], tournament) + local queriedPoints = self:queryPlacement(aliases[tournamentIndex], parsedOpponent.opponent, tournament) if not queriedPoints then return {} @@ -203,14 +204,21 @@ end ---@return string[][] function AutomaticPointsTable:parseAliases(args, opponent, tournamentCount) local aliases = {} - local lastAliases = TeamTemplate.queryHistoricalNames(Opponent.toName(opponent)) - - for index = 1, tournamentCount do - if String.isNotEmpty(args['alias' .. index]) then - lastAliases = TeamTemplate.queryHistoricalNames(args['alias' .. index]) + local name = Opponent.toName(opponent) + if (opponent.type == Opponent.team) then + local lastAliases = TeamTemplate.queryHistoricalNames(name) + for index = 1, tournamentCount do + if String.isNotEmpty(args['alias' .. index]) then + lastAliases = TeamTemplate.queryHistoricalNames(args['alias' .. index]) + end + aliases[index] = lastAliases + end + else + for index = 1, tournamentCount do + aliases[index] = {name} end - aliases[index] = lastAliases end + return aliases end @@ -236,12 +244,13 @@ function AutomaticPointsTable:parseDeduction(args, tournament, tournamentIndex) end ---@param aliases string[] +---@param opponent standardOpponent ---@param tournament StandardTournament -function AutomaticPointsTable:queryPlacement(aliases, tournament) +function AutomaticPointsTable:queryPlacement(aliases, opponent, tournament) + local conditionType = (opponent.type == 'team') and 'opponenttemplate' or 'opponentname' local conditions = ConditionTree(BooleanOperator.all):add{ ConditionNode(ColumnName('parent'), Comparator.eq, tournament.pageName), - ConditionNode(ColumnName('opponenttype'), Comparator.eq, Opponent.team), - Condition.Util.anyOf(ColumnName('opponenttemplate'), aliases), + Condition.Util.anyOf(ColumnName(conditionType), aliases), } local result = mw.ext.LiquipediaDB.lpdb('placement', { conditions = tostring(conditions), diff --git a/lua/wikis/commons/Widget/AutomaticPointsTable.lua b/lua/wikis/commons/Widget/AutomaticPointsTable.lua index 75c8b591868..2301e5db3e6 100644 --- a/lua/wikis/commons/Widget/AutomaticPointsTable.lua +++ b/lua/wikis/commons/Widget/AutomaticPointsTable.lua @@ -86,7 +86,7 @@ function AutomaticPointsTableWidget:createHeader() classes = {'divHeaderRow', 'diagonal'}, children = WidgetUtil.collect( AutomaticPointsTableWidget._createHeaderCell('Ranking','ranking'), - AutomaticPointsTableWidget._createHeaderCell('Team', 'team'), + AutomaticPointsTableWidget._createHeaderCell('Participant', 'participant'), AutomaticPointsTableWidget._createHeaderCell('Total Points'), Array.flatMap(tournaments, function (tournament) return { @@ -137,7 +137,7 @@ function AutomaticPointsTableWidget:createRow(opponent, opponentIndex) AutomaticPointsTableWidget._createRowCell{ additionalClasses = {'name-cell'}, background = opponent.background, - children = OpponentDisplay.BlockOpponent{opponent = opponent.opponent, note = opponent.note}, + children = OpponentDisplay.BlockOpponent{opponent = opponent.opponent, note = opponent.note, showPlayerTeam = true}, }, self:_createTotalPointsCell(opponent), Array.flatMap(opponent.results, function (result, resultIndex) diff --git a/stylesheets/commons/AutomaticPointsTable.scss b/stylesheets/commons/AutomaticPointsTable.scss index f4c811e2372..043847157e7 100644 --- a/stylesheets/commons/AutomaticPointsTable.scss +++ b/stylesheets/commons/AutomaticPointsTable.scss @@ -26,7 +26,7 @@ Author(s): XtratoS transform: translate( 50.5px, 79px ) rotate( -45deg ); } -.automatic-points-table .diagonal-header-div-cell.team { +.automatic-points-table .diagonal-header-div-cell.participant { min-width: 225px; max-width: 225px; transform: translate( 212px, 12.5px ) rotate( -45deg ); From 8dd00353df78b7a43dc1ccf8aacae62ab40a5dc5 Mon Sep 17 00:00:00 2001 From: Soba Date: Thu, 26 Feb 2026 15:47:36 +0300 Subject: [PATCH 2/3] fix linter problems --- lua/wikis/commons/Widget/AutomaticPointsTable.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/AutomaticPointsTable.lua b/lua/wikis/commons/Widget/AutomaticPointsTable.lua index 2301e5db3e6..ebac7fc4353 100644 --- a/lua/wikis/commons/Widget/AutomaticPointsTable.lua +++ b/lua/wikis/commons/Widget/AutomaticPointsTable.lua @@ -137,7 +137,10 @@ function AutomaticPointsTableWidget:createRow(opponent, opponentIndex) AutomaticPointsTableWidget._createRowCell{ additionalClasses = {'name-cell'}, background = opponent.background, - children = OpponentDisplay.BlockOpponent{opponent = opponent.opponent, note = opponent.note, showPlayerTeam = true}, + children = OpponentDisplay.BlockOpponent{opponent = opponent.opponent, + note = opponent.note, + showPlayerTeam = true + }, }, self:_createTotalPointsCell(opponent), Array.flatMap(opponent.results, function (result, resultIndex) From 11acfa3d114eca78b27051b2ed9358535f961720 Mon Sep 17 00:00:00 2001 From: SobakaPirat <40334641+SobakaPirat@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:18:25 +0300 Subject: [PATCH 3/3] adjust formatting Co-authored-by: hjpalpha <75081997+hjpalpha@users.noreply.github.com> --- lua/wikis/commons/Widget/AutomaticPointsTable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/Widget/AutomaticPointsTable.lua b/lua/wikis/commons/Widget/AutomaticPointsTable.lua index ebac7fc4353..36ace5fbd7b 100644 --- a/lua/wikis/commons/Widget/AutomaticPointsTable.lua +++ b/lua/wikis/commons/Widget/AutomaticPointsTable.lua @@ -138,9 +138,9 @@ function AutomaticPointsTableWidget:createRow(opponent, opponentIndex) additionalClasses = {'name-cell'}, background = opponent.background, children = OpponentDisplay.BlockOpponent{opponent = opponent.opponent, - note = opponent.note, - showPlayerTeam = true - }, + note = opponent.note, + showPlayerTeam = true + }, }, self:_createTotalPointsCell(opponent), Array.flatMap(opponent.results, function (result, resultIndex)