From 9b3c4184dd4849dafab7cfa59694a77925e653cc Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:33:08 +0900 Subject: [PATCH 01/29] clean up condition building syntax --- lua/wikis/commons/ResultsTable/Base.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 2ed49915e25..137cf3a2b03 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -212,30 +212,32 @@ function BaseResultsTable:buildBaseConditions() :add{self:buildOpponentConditions()} if args.game then - conditions:add{ConditionNode(ColumnName('game'), Comparator.eq, args.game)} + conditions:add(ConditionNode(ColumnName('game'), Comparator.eq, args.game)) end local startDate = args.startdate or args.sdate if startDate then -- intentional > here to keep it as is in current modules -- possibly change to >= later - conditions:add{ConditionNode(ColumnName('date'), Comparator.gt, startDate)} + conditions:add(ConditionNode(ColumnName('date'), Comparator.gt, startDate)) end local endDate = args.enddate or args.edate if endDate then -- intentional < here to keep it as is in current modules -- possibly change to <= later - conditions:add{ConditionNode(ColumnName('date'), Comparator.lt, endDate)} + conditions:add(ConditionNode(ColumnName('date'), Comparator.lt, endDate)) end if args.placement then - conditions:add{ConditionNode(ColumnName('placement'), Comparator.eq, args.placement)} + conditions:add(ConditionNode(ColumnName('placement'), Comparator.eq, args.placement)) elseif Logic.readBool(args.awards) then - conditions:add{ConditionNode(ColumnName('mode'), Comparator.eq, 'award_individual')} + conditions:add(ConditionNode(ColumnName('mode'), Comparator.eq, 'award_individual')) else - conditions:add{ConditionNode(ColumnName('mode'), Comparator.neq, 'award_individual')} - conditions:add{ConditionNode(ColumnName('placement'), Comparator.neq, '')} + conditions:add{ + ConditionNode(ColumnName('mode'), Comparator.neq, 'award_individual'), + ConditionNode(ColumnName('placement'), Comparator.neq, '') + } end if args.tier then From 896e2142b490ce6035bddad81a7849fdcd2abc7d Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:35:05 +0900 Subject: [PATCH 02/29] type anno --- lua/wikis/commons/ResultsTable/Base.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 137cf3a2b03..ea410079068 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -250,7 +250,7 @@ function BaseResultsTable:buildBaseConditions() end ---Builds Lpdb conditions for the given opponent ----@return table? +---@return ConditionTree? function BaseResultsTable:buildOpponentConditions() local config = self.config @@ -263,7 +263,7 @@ end -- todo: adjust once #1802 is done ---Builds Lpdb conditions for the non team opponent case ----@return table +---@return ConditionTree function BaseResultsTable:buildNonTeamOpponentConditions() local config = self.config local opponentConditions = ConditionTree(BooleanOperator.any) @@ -306,7 +306,7 @@ function BaseResultsTable:buildNonTeamOpponentConditions() end ---Builds Lpdb conditions for a team ----@return table +---@return ConditionTree function BaseResultsTable:buildTeamOpponentConditions() local config = self.config From 560162107624e3fe4d8020e3c2f319c8a109a928 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:41:46 +0900 Subject: [PATCH 03/29] simplify opponent conditions --- lua/wikis/commons/ResultsTable/Base.lua | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index ea410079068..1be406e3cb9 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -280,26 +280,21 @@ function BaseResultsTable:buildNonTeamOpponentConditions() local prefix if config.queryType == QUERY_TYPES.solo then prefix = PLAYER_PREFIX - opponentConditions:add{ - ConditionTree(BooleanOperator.all):add{ - ConditionNode(ColumnName('opponenttype'), Comparator.eq, Opponent.solo), - ConditionNode(ColumnName('opponentname'), Comparator.eq, opponent), - }, - ConditionTree(BooleanOperator.all):add{ - ConditionNode(ColumnName('opponenttype'), Comparator.eq, Opponent.solo), - ConditionNode(ColumnName('opponentname'), Comparator.eq, opponentWithUnderscore), - }, - } + opponentConditions:add(ConditionTree(BooleanOperator.all):add{ + ConditionNode(ColumnName('opponenttype'), Comparator.eq, Opponent.solo), + ConditionUtil.anyOf(ColumnName('opponentname'), {opponent, opponentWithUnderscore}) + }) else prefix = COACH_PREFIX end - for playerIndex = 1, config.playerLimit do + Array.forEach(Array.range(1, config.playerLimit), function (playerIndex) + local playerColumnName = ColumnName('opponentplayers_' .. prefix .. playerIndex) opponentConditions:add{ - ConditionNode(ColumnName('opponentplayers_' .. prefix .. playerIndex), Comparator.eq, opponent), - ConditionNode(ColumnName('opponentplayers_' .. prefix .. playerIndex), Comparator.eq, opponentWithUnderscore), + ConditionNode(playerColumnName, Comparator.eq, opponent), + ConditionNode(playerColumnName, Comparator.eq, opponentWithUnderscore), } - end + end) end return opponentConditions From 6cc81de29a964c294ffb8cabefa85b9ba7b848bd Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:47:10 +0900 Subject: [PATCH 04/29] Array.forEach --- lua/wikis/commons/ResultsTable/Base.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 1be406e3cb9..62a17fb9c6a 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -270,7 +270,7 @@ function BaseResultsTable:buildNonTeamOpponentConditions() local opponents = Array.append(config.aliases, config.opponent) - for _, opponent in pairs(opponents) do + Array.forEach(opponents, function (opponent) opponent = config.resolveOpponent and mw.ext.TeamLiquidIntegration.resolve_redirect(opponent) or opponent @@ -295,7 +295,7 @@ function BaseResultsTable:buildNonTeamOpponentConditions() ConditionNode(playerColumnName, Comparator.eq, opponentWithUnderscore), } end) - end + end) return opponentConditions end @@ -342,13 +342,13 @@ function BaseResultsTable:buildPlayersOnTeamOpponentConditions(opponentTeamTempl local opponentConditions = ConditionTree(BooleanOperator.any) local prefix = PLAYER_PREFIX - for _, teamTemplate in pairs(opponentTeamTemplates) do + Array.forEach(opponentTeamTemplates, function (teamTemplate) for playerIndex = 1, config.playerLimit do opponentConditions:add{ ConditionNode(ColumnName('opponentplayers_' .. prefix .. playerIndex .. 'template'), Comparator.eq, teamTemplate), } end - end + end) return ConditionTree(BooleanOperator.all):add{ opponentConditions, From d548bc5d47bb097589d93b5bb7078efe0cb34b3c Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:49:16 +0900 Subject: [PATCH 05/29] access modifiers --- lua/wikis/commons/ResultsTable/Base.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 62a17fb9c6a..2b2d71820da 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -393,7 +393,7 @@ function BaseResultsTable:build() :node(displayTable) end ----comment +---@private ---@param placementData table ---@return Html[] function BaseResultsTable:_buildRows(placementData) @@ -412,8 +412,8 @@ function BaseResultsTable:_buildRows(placementData) return rows end --- overwritable ---Applies the row highlight +---@protected ---@param placement table ---@return string? function BaseResultsTable:rowHighlight(placement) @@ -422,8 +422,8 @@ function BaseResultsTable:rowHighlight(placement) end end --- overwritable ---Builds the tier display +---@protected ---@param placement table ---@return string?, string? function BaseResultsTable:tierDisplay(placement) @@ -438,8 +438,8 @@ function BaseResultsTable:tierDisplay(placement) return Tier.display(tier, tierType, options), Tier.toSortValue(tier, tierType) end --- overwritable ---Builds the opponent display +---@protected ---@param data table ---@param options table? ---@return Widget|Html? @@ -503,7 +503,7 @@ end ---Builds team icon display with text below it ---@param teamDisplay Widget ----@param rawTeamTemplate table +---@param rawTeamTemplate teamTemplateData ---@param flip boolean? ---@return Html function BaseResultsTable.teamIconDisplayWithText(teamDisplay, rawTeamTemplate, flip) @@ -553,10 +553,12 @@ function BaseResultsTable:processVsData(placement) return score, vsDisplay end +---@protected function BaseResultsTable:buildHeader() error('Function "buildHeader" needs to be set via the module that requires "Module:BaseResultsTable/Base"') end +---@protected ---@param placement table function BaseResultsTable:buildRow(placement) error('Function "buildRow" needs to be set via the module that requires "Module:BaseResultsTable/Base"') From 47497aa13ad69bf016a3d1cd6bf0b9f0ea1af703 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:54:21 +0900 Subject: [PATCH 06/29] add column definition function --- lua/wikis/commons/ResultsTable/Base.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 2b2d71820da..791ef07d29a 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -553,6 +553,12 @@ function BaseResultsTable:processVsData(placement) return score, vsDisplay end +---@protected +---@return table[] +function BaseResultsTable:buildColumnDefinitions() + error('Function "buildColumnDefinitions" needs to be set via the module that requires "Module:BaseResultsTable/Base"') +end + ---@protected function BaseResultsTable:buildHeader() error('Function "buildHeader" needs to be set via the module that requires "Module:BaseResultsTable/Base"') From 92fd4404bb545331086eed62db40c7480e9fed68 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:55:22 +0900 Subject: [PATCH 07/29] simplify error message --- lua/wikis/commons/ResultsTable/Base.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 791ef07d29a..3ad3e3ae8d7 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -556,18 +556,18 @@ end ---@protected ---@return table[] function BaseResultsTable:buildColumnDefinitions() - error('Function "buildColumnDefinitions" needs to be set via the module that requires "Module:BaseResultsTable/Base"') + error('BaseResultsTable:buildColumnDefinitions() cannot be called directly and must be overridden.') end ---@protected function BaseResultsTable:buildHeader() - error('Function "buildHeader" needs to be set via the module that requires "Module:BaseResultsTable/Base"') + error('BaseResultsTable:buildHeader() cannot be called directly and must be overridden.') end ---@protected ---@param placement table function BaseResultsTable:buildRow(placement) - error('Function "buildRow" needs to be set via the module that requires "Module:BaseResultsTable/Base"') + error('BaseResultsTable:buildRow() cannot be called directly and must be overridden.') end return BaseResultsTable From d20713eb0e94eb12eac46e4f334c177344c3a4de Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:27:17 +0900 Subject: [PATCH 08/29] use widgets --- lua/wikis/commons/ResultsTable/Base.lua | 125 ++++++++++++++---------- 1 file changed, 75 insertions(+), 50 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 3ad3e3ae8d7..2e0987647de 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -31,6 +31,11 @@ local BooleanOperator = Condition.BooleanOperator local ColumnName = Condition.ColumnName local ConditionUtil = Condition.Util +local HtmlWidgets = Lua.import('Module:Widget/Html/All') +local LinkWidget = Lua.import('Module:Widget/Basic/Link') +local TableWidgets = Lua.import('Module:Widget/Table2/All') +local WidgetUtil = Lua.import('Module:Widget/Util') + local DEFAULT_VALUES = { order = 'desc', resolveOpponent = true, @@ -356,41 +361,45 @@ function BaseResultsTable:buildPlayersOnTeamOpponentConditions(opponentTeamTempl } end +---@private +---@return boolean +function BaseResultsTable:_isDataEmpty() + return Table.isEmpty(self.data) or Table.isEmpty(self.data[1]) +end + ---Builds the results/achievements/awards table ---@return Html function BaseResultsTable:build() - local displayTable = mw.html.create('table') - :addClass('wikitable wikitable-striped sortable') - :css('text-align', 'center') - :node(self:buildHeader()) - - if Table.isEmpty(self.data) or Table.isEmpty(self.data[1]) then - return displayTable:node(mw.html.create('tr') - :tag('td'):attr('colspan', 42):wikitext('No recorded results found.')) - end - - -- Hidden tr that contains a td to prevent the first yearHeader from being inside thead - displayTable:node(mw.html.create('tr'):css('display', 'none'):tag('td'):allDone()) - - for _, dataSet in ipairs(self.data) do - for _, row in ipairs(self:_buildRows(dataSet)) do - displayTable:node(row) - end - end + return TableWidgets{ + columns = self:buildColumnDefinitions(), + children = { + TableWidgets.TableHeader{children = {self:buildHeader()}}, + -- Hidden tr that contains a td to prevent the first yearHeader from being inside thead + self:_isDataEmpty() and HtmlWidgets.Tr{ + css = {display = 'none'}, + children = HtmlWidgets.Td{} + } or nil, + TableWidgets.TableBody{children = WidgetUtil.collect(self:_buildTableBody(), self.args.manualContent)} + }, + footer = self.config.onlyAchievements and HtmlWidgets.I{children = LinkWidget{ + link = self.config.opponent .. '/' .. self.config.resultsSubPage, + children = 'Extended list of results', + }} or nil + } +end - if self.config.onlyAchievements then - displayTable:tag('tr') - :tag('th') - :attr('colspan', 42) - :css('font-style', 'italic') - :wikitext('[[' .. self.config.opponent .. '/' .. self.config.resultsSubPage .. '|Extended list of results]]') +---@private +---@return Widget[] +function BaseResultsTable:_buildTableBody() + if self:_isDataEmpty() then + return {TableWidgets.Row{children = TableWidgets.Cell{ + colspan = 42, + children = 'No recorded results found.' + }}} end - - displayTable:node(self.args.manualContent) - - return mw.html.create('div') - :addClass('table-responsive') - :node(displayTable) + return Array.flatMap(self.data, function (dataSet) + return self:_buildRows(dataSet) + end) end ---@private @@ -400,9 +409,15 @@ function BaseResultsTable:_buildRows(placementData) local rows = {} if placementData.header then - table.insert(rows, mw.html.create('tr'):addClass('sortbottom') - :tag('th'):attr('colspan', 42):wikitext(placementData.header):done() - :done()) + table.insert(rows, TableWidgets.Row{ + classes = {'sortbottom'}, + css = {['font-weight'] = 'bold'}, + children = TableWidgets.CellHeader{ + align = 'center', + colspan = 42, + children = placementData.header + } + }) end for _, placement in ipairs(placementData) do @@ -442,12 +457,12 @@ end ---@protected ---@param data table ---@param options table? ----@return Widget|Html? +---@return string|Widget? function BaseResultsTable:opponentDisplay(data, options) options = options or {} if not data.opponenttype then - return mw.html.create():wikitext('-') + return '-' elseif data.opponenttype ~= Opponent.team and (data.opponenttype ~= Opponent.solo or not options.teamForSolo) then return OpponentDisplay.BlockOpponent{ opponent = Opponent.fromLpdbStruct(data) --[[@as standardOpponent]], @@ -505,21 +520,29 @@ end ---@param teamDisplay Widget ---@param rawTeamTemplate teamTemplateData ---@param flip boolean? ----@return Html +---@return Widget function BaseResultsTable.teamIconDisplayWithText(teamDisplay, rawTeamTemplate, flip) - return mw.html.create() - :node(teamDisplay) - :node(mw.html.create('div') - :css('width', '60px') - :css('float', flip and 'right' or 'left') - :node( - mw.html.create('div') - :css('line-height', '1') - :css('font-size', '80%') - :css('text-align', 'center') - :wikitext('([[' .. rawTeamTemplate.page .. '|' .. rawTeamTemplate.shortname .. ']])') - ) - ) + return HtmlWidgets.Fragment{children = { + teamDisplay, + HtmlWidgets.Div{ + css = { + width = '60px', + float = flip and 'right' or 'left', + }, + children = HtmlWidgets.Div{ + css = { + ['line-height'] = 1, + ['font-size'] = '80%', + ['text-align'] = 'center', + }, + children = { + '(', + LinkWidget{link = rawTeamTemplate.page, children = rawTeamTemplate.shortname}, + ')' + } + } + } + }} end ---Builds the tournament display name @@ -535,7 +558,7 @@ end ---Converts the lastvsdata to display components ---@param placement table ----@return string, Widget|Html?, string? +---@return string, string|Widget?, string? function BaseResultsTable:processVsData(placement) local lastVs = placement.lastvsdata or {} @@ -560,12 +583,14 @@ function BaseResultsTable:buildColumnDefinitions() end ---@protected +---@return Widget function BaseResultsTable:buildHeader() error('BaseResultsTable:buildHeader() cannot be called directly and must be overridden.') end ---@protected ---@param placement table +---@return Widget function BaseResultsTable:buildRow(placement) error('BaseResultsTable:buildRow() cannot be called directly and must be overridden.') end From 88c90d9c380dd74f93e7a3ee2e6733f14758f699 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:29:05 +0900 Subject: [PATCH 09/29] type annotation --- lua/wikis/commons/ResultsTable/Base.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 2e0987647de..7b2bae67adc 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -429,7 +429,7 @@ end ---Applies the row highlight ---@protected ----@param placement table +---@param placement placement ---@return string? function BaseResultsTable:rowHighlight(placement) if HighlightConditions.tournament(placement, self.config) then @@ -439,7 +439,7 @@ end ---Builds the tier display ---@protected ----@param placement table +---@param placement placement ---@return string?, string? function BaseResultsTable:tierDisplay(placement) local tier, tierType, options = Tier.parseFromQueryData(placement) @@ -455,7 +455,7 @@ end ---Builds the opponent display ---@protected ----@param data table +---@param data placement ---@param options table? ---@return string|Widget? function BaseResultsTable:opponentDisplay(data, options) @@ -546,7 +546,7 @@ function BaseResultsTable.teamIconDisplayWithText(teamDisplay, rawTeamTemplate, end ---Builds the tournament display name ----@param placement table +---@param placement placement ---@return string function BaseResultsTable.tournamentDisplayName(placement) if String.isNotEmpty(placement.tournament) then @@ -557,7 +557,7 @@ function BaseResultsTable.tournamentDisplayName(placement) end ---Converts the lastvsdata to display components ----@param placement table +---@param placement placement ---@return string, string|Widget?, string? function BaseResultsTable:processVsData(placement) local lastVs = placement.lastvsdata or {} @@ -589,7 +589,7 @@ function BaseResultsTable:buildHeader() end ---@protected ----@param placement table +---@param placement placement ---@return Widget function BaseResultsTable:buildRow(placement) error('BaseResultsTable:buildRow() cannot be called directly and must be overridden.') From 3e2bd36278f5b51783fbe885ff1e4a6323a964d0 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:46:27 +0900 Subject: [PATCH 10/29] update awards table --- lua/wikis/commons/ResultsTable/Award.lua | 172 ++++++++++++++--------- lua/wikis/commons/ResultsTable/Base.lua | 6 +- 2 files changed, 110 insertions(+), 68 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index 7a04c82f162..65ea63ef8a0 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -11,89 +11,133 @@ local Class = Lua.import('Module:Class') local Currency = Lua.import('Module:Currency') local DateExt = Lua.import('Module:Date/Ext') local LeagueIcon = Lua.import('Module:LeagueIcon') -local Page = Lua.import('Module:Page') local Opponent = Lua.import('Module:Opponent/Custom') local BaseResultsTable = Lua.import('Module:ResultsTable/Base') +local LinkWidget = Lua.import('Module:Widget/Basic/Link') +local TableWidgets = Lua.import('Module:Widget/Table2/All') +local WidgetUtil = Lua.import('Module:Widget/Util') + ---@class AwardsTable: BaseResultsTable ---@operator call(table): AwardsTable local AwardsTable = Class.new(BaseResultsTable) +function AwardsTable:buildColumnDefinitions() + return WidgetUtil.collect( + { + align = 'center', + sortType = 'isoDate', + }, + { + align = 'center', + minWidth = '75px', + }, + self.config.showType and { + align = 'center', + minWidth = '50px', + } or nil, + {align = 'center'}, + {align = 'center'}, + { + align = 'center', + minWidth = '225px', + }, + self.config.queryType ~= Opponent.team and { + align = 'center', + minWidth = '70px', + } or self.config.playerResultsOfTeam and { + align = 'center', + minWidth = '105px', + } or nil, + { + align = 'center', + sortType = 'currency', + } + ) +end + ---Builds the Header of the award table ----@return Html +---@return Widget function AwardsTable:buildHeader() - local header = mw.html.create('tr') - :tag('th'):css('width', '100px'):wikitext('Date'):done() - :tag('th'):css('min-width', '75px'):wikitext('Tier'):done() - - if self.config.showType then - header:tag('th'):css('min-width', '50px'):wikitext('Type') - end - - header - :tag('th'):css('width', '275px'):attr('colspan', 2):wikitext('Tournament'):done() - :tag('th'):css('min-width', '225px'):wikitext('Award') - - if self.config.queryType ~= Opponent.team then - header:tag('th'):css('min-width', '70px'):wikitext('Team') - elseif self.config.playerResultsOfTeam then - header:tag('th'):css('min-width', '105px'):wikitext('Player') - end - - header:tag('th'):attr('data-sort-type', 'currency'):wikitext('Prize') - - return header + return TableWidgets.Row{children = WidgetUtil.collect( + TableWidgets.CellHeader{children = 'Date'}, + TableWidgets.CellHeader{children = 'Tier'}, + self.config.showType and TableWidgets.CellHeader{children = 'Type'} or nil, + TableWidgets.CellHeader{ + colspan = 2, + children = 'Tournament' + }, + TableWidgets.CellHeader{children = 'Award'}, + self.config.queryType ~= Opponent.team and TableWidgets.CellHeader{ + children = 'Team' + } or self.config.playerResultsOfTeam and TableWidgets.CellHeader{ + children = 'Player' + } or nil, + TableWidgets.CellHeader{children = 'Prize'} + )} end ---Builds a row of the award table ----@param placement table ----@return Html +---@param placement placement +---@return Widget function AwardsTable:buildRow(placement) - local row = mw.html.create('tr') - :addClass(self:rowHighlight(placement)) - :tag('td'):wikitext(DateExt.toYmdInUtc(placement.date)):done() - local tierDisplay, tierSortValue = self:tierDisplay(placement) - row:tag('td'):attr('data-sort-value', tierSortValue):wikitext(tierDisplay) - - if self.config.showType then - row:tag('td'):wikitext(placement.type) - end - local tournamentDisplayName = BaseResultsTable.tournamentDisplayName(placement) - row - :tag('td'):css('width', '30px'):attr('data-sort-value', tournamentDisplayName):wikitext(LeagueIcon.display{ - icon = placement.icon, - iconDark = placement.icondark, - link = placement.parent, - name = tournamentDisplayName, - options = {noTemplate = true}, - }):done() - :tag('td'):attr('data-sort-value', tournamentDisplayName):css('text-align', 'left'):wikitext(Page.makeInternalLink( - {}, - tournamentDisplayName, - placement.pagename - )) - - row:tag('td'):wikitext(placement.extradata.award) - - if self.config.playerResultsOfTeam or self.config.queryType ~= Opponent.team then - row:tag('td'):css('text-align', 'left'):attr('data-sort-value', placement.opponentname):node(self:opponentDisplay( - placement, - {teamForSolo = not self.config.playerResultsOfTeam} - )) - end - - row:tag('td'):wikitext(Currency.display('USD', - self.config.queryType ~= Opponent.team and placement.individualprizemoney or placement.prizemoney, - {dashIfZero = true, displayCurrencyCode = false, formatValue = true} - )) - - return row + return TableWidgets.Row{ + highlighted = self:rowHighlight(placement), + children = WidgetUtil.collect( + TableWidgets.Cell{children = DateExt.toYmdInUtc(placement.date)}, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tierSortValue + }, + children = tierDisplay + }, + self.config.showType and TableWidgets.Cell{ + children = placement.type + } or nil, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tournamentDisplayName + }, + css = {width = '30px'}, + children = LeagueIcon.display{ + icon = placement.icon, + iconDark = placement.icondark, + link = placement.parent, + name = tournamentDisplayName, + options = {noTemplate = true}, + } + }, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tournamentDisplayName + }, + children = LinkWidget{ + children = tournamentDisplayName, + link = placement.pagename, + } + }, + TableWidgets.Cell{children = placement.extradata.award}, + (self.config.playerResultsOfTeam or self.config.queryType ~= Opponent.team) and TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = placement.opponentname + }, + children = self:opponentDisplay( + placement, + {teamForSolo = not self.config.playerResultsOfTeam} + ) + } or nil, + TableWidgets.Cell{children = Currency.display('USD', + self.config.queryType ~= Opponent.team and placement.individualprizemoney or placement.prizemoney, + {dashIfZero = true, displayCurrencyCode = false, formatValue = true} + )} + ) + } end return AwardsTable diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 7b2bae67adc..f6747eb5836 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -430,11 +430,9 @@ end ---Applies the row highlight ---@protected ---@param placement placement ----@return string? +---@return boolean function BaseResultsTable:rowHighlight(placement) - if HighlightConditions.tournament(placement, self.config) then - return 'tournament-highlighted-bg' - end + return HighlightConditions.tournament(placement, self.config) end ---Builds the tier display From c7a3d932995841cec631ddd585e3779ad4833c36 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:50:47 +0900 Subject: [PATCH 11/29] syntax --- lua/wikis/commons/ResultsTable/Base.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index f6747eb5836..9e8eb71e965 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -368,9 +368,9 @@ function BaseResultsTable:_isDataEmpty() end ---Builds the results/achievements/awards table ----@return Html +---@return Widget function BaseResultsTable:build() - return TableWidgets{ + return TableWidgets.Table{ columns = self:buildColumnDefinitions(), children = { TableWidgets.TableHeader{children = {self:buildHeader()}}, From 5e236a2ad4bdb84940070f646b156a8dc0544d05 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:57:53 +0900 Subject: [PATCH 12/29] fixes --- lua/wikis/commons/ResultsTable/Award.lua | 1 + lua/wikis/commons/ResultsTable/Base.lua | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index 65ea63ef8a0..9fdc7e68046 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -117,6 +117,7 @@ function AwardsTable:buildRow(placement) attributes = { ['data-sort-value'] = tournamentDisplayName }, + align = 'left', children = LinkWidget{ children = tournamentDisplayName, link = placement.pagename, diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 9e8eb71e965..84a67af487f 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -371,16 +371,17 @@ end ---@return Widget function BaseResultsTable:build() return TableWidgets.Table{ + sortable = true, columns = self:buildColumnDefinitions(), - children = { + children = WidgetUtil.collect( TableWidgets.TableHeader{children = {self:buildHeader()}}, -- Hidden tr that contains a td to prevent the first yearHeader from being inside thead - self:_isDataEmpty() and HtmlWidgets.Tr{ + not self:_isDataEmpty() and HtmlWidgets.Tr{ css = {display = 'none'}, children = HtmlWidgets.Td{} } or nil, TableWidgets.TableBody{children = WidgetUtil.collect(self:_buildTableBody(), self.args.manualContent)} - }, + ), footer = self.config.onlyAchievements and HtmlWidgets.I{children = LinkWidget{ link = self.config.opponent .. '/' .. self.config.resultsSubPage, children = 'Extended list of results', From d561ba46e7c959f79e8c9d8747a432bbf9ccc207 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:25:46 +0900 Subject: [PATCH 13/29] update results table --- lua/wikis/commons/ResultsTable.lua | 258 +++++++++++++++++++---------- 1 file changed, 173 insertions(+), 85 deletions(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index c02be12758e..1292b98e071 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -7,13 +7,12 @@ local Lua = require('Module:Lua') -local Abbreviation = Lua.import('Module:Abbreviation') local Class = Lua.import('Module:Class') local Currency = Lua.import('Module:Currency') local DateExt = Lua.import('Module:Date/Ext') +local FnUtil = Lua.import('Module:FnUtil') local Game = Lua.import('Module:Game') local LeagueIcon = Lua.import('Module:LeagueIcon') -local Page = Lua.import('Module:Page') local Placement = Lua.import('Module:Placement') local Table = Lua.import('Module:Table') @@ -21,108 +20,197 @@ local BaseResultsTable = Lua.import('Module:ResultsTable/Base') local Opponent = Lua.import('Module:Opponent/Custom') +local HtmlWidgets = Lua.import('Module:Widget/Html/All') +local LinkWidget = Lua.import('Module:Widget/Basic/Link') +local TableWidgets = Lua.import('Module:Widget/Table2/All') +local WidgetUtil = Lua.import('Module:Widget/Util') + ---@class ResultsTable: BaseResultsTable ---@operator call(table): ResultsTable local ResultsTable = Class.new(BaseResultsTable) +function ResultsTable:buildColumnDefinitions() + return WidgetUtil.collect( + { + align = 'center', + sortType = 'isoDate', + }, + { + align = 'center', + minWidth = '80px', + }, + { + align = 'center', + minWidth = '75px', + }, + self.config.showType and { + align = 'center', + minWidth = '50px', + } or nil, + self.config.displayGameIcons and { + align = 'center' + } or nil, + {align = 'center'}, + {align = 'center'}, + (self.config.queryType ~= Opponent.team or Table.isNotEmpty(self.config.aliases)) and { + align = 'center', + minWidth = '70px', + } or self.config.playerResultsOfTeam and { + align = 'center', + minWidth = '105px', + } or nil, + not self.config.hideResult and { + { + align = 'center', + sortable = false, + }, + { + align = 'center', + sortable = false, + }, + } or nil, + { + align = 'center', + sortType = 'currency', + } + ) +end + ---Builds the Header of the results/achievements table ----@return Html +---@return Widget function ResultsTable:buildHeader() - local header = mw.html.create('tr') - :tag('th'):css('width', '100px'):wikitext('Date'):done() - :tag('th'):css('min-width', '80px'):wikitext('Place'):done() - :tag('th'):css('min-width', '75px'):wikitext('Tier'):done() - - if self.config.showType then - header:tag('th'):css('min-width', '50px'):wikitext('Type') - end - - if self.config.displayGameIcons then - header:tag('th'):node(Abbreviation.make{text = 'G.', title = 'Game'}) - end - - header:tag('th'):css('width', '420px'):attr('colspan', 2):wikitext('Tournament') - - if self.config.queryType ~= Opponent.team or Table.isNotEmpty(self.config.aliases) then - header:tag('th'):css('min-width', '70px'):wikitext('Team') - elseif self.config.playerResultsOfTeam then - header:tag('th'):css('min-width', '105px'):wikitext('Player') - end - - if not self.config.hideResult then - header:tag('th'):css('min-width', '105px'):attr('colspan', 2):addClass('unsortable'):wikitext('Result') - end - - header:tag('th'):attr('data-sort-type', 'currency'):wikitext('Prize') - - return header + return TableWidgets.Row{children = WidgetUtil.collect( + TableWidgets.CellHeader{children = 'Date'}, + TableWidgets.CellHeader{children = 'Place'}, + TableWidgets.CellHeader{children = 'Tier'}, + self.config.showType and TableWidgets.CellHeader{children = 'Type'} or nil, + self.config.displayGameIcons and TableWidgets.CellHeader{ + children = HtmlWidgets.Abbreviation{children = 'G.', title = 'Game'} + } or nil, + TableWidgets.CellHeader{ + colspan = 2, + children = 'Tournament' + }, + (self.config.queryType ~= Opponent.team or Table.isNotEmpty(self.config.aliases)) and TableWidgets.CellHeader{ + children = 'Team' + } or self.config.playerResultsOfTeam and TableWidgets.CellHeader{ + children = 'Player' + } or nil, + not self.config.hideResult and TableWidgets.CellHeader{ + colspan = 2, + children = 'Result' + } or nil, + TableWidgets.CellHeader{children = 'Prize'} + )} end ---Builds a placement row of the results/achievements table ---@param placement table ---@return Html function ResultsTable:buildRow(placement) - local placementCell = mw.html.create('td') - Placement._placement{parent = placementCell, placement = placement.placement} - - local row = mw.html.create('tr') - :addClass(self:rowHighlight(placement)) - :tag('td'):wikitext(DateExt.toYmdInUtc(placement.date)):done() - :node(placementCell) - local tierDisplay, tierSortValue = self:tierDisplay(placement) - row:tag('td'):attr('data-sort-value', tierSortValue):wikitext(tierDisplay) - - if self.config.showType then - row:tag('td'):wikitext(placement.type) - end - - if self.config.displayGameIcons then - row:tag('td'):node(Game.icon{game = placement.game}) - end - local tournamentDisplayName = BaseResultsTable.tournamentDisplayName(placement) - row - :tag('td'):css('width', '30px'):attr('data-sort-value', tournamentDisplayName):wikitext(LeagueIcon.display{ - icon = placement.icon, - iconDark = placement.icondark, - link = placement.parent, - name = tournamentDisplayName, - options = {noTemplate = true}, - }):done() - :tag('td'):attr('data-sort-value', tournamentDisplayName):css('text-align', 'left'):wikitext(Page.makeInternalLink( - {}, - tournamentDisplayName, - placement.pagename - )) - - if self.config.playerResultsOfTeam or - self.config.queryType ~= Opponent.team or - Table.isNotEmpty(self.config.aliases) then + local useIndivPrize = self.config.useIndivPrize and self.config.queryType ~= Opponent.team - row:tag('td'):css('text-align', self.config.hideResult and 'left' or 'right') - :attr('data-sort-value', placement.opponentname) - :node(self:opponentDisplay(placement, - {teamForSolo = not self.config.playerResultsOfTeam, flip = not self.config.hideResult} - )) - end + return TableWidgets.Row{ + highlighted = self:rowHighlight(placement), + children = WidgetUtil.collect( + TableWidgets.Cell{children = DateExt.toYmdInUtc(placement.date)}, + ResultsTable._placementToTableCell(placement), + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tierSortValue + }, + children = tierDisplay + }, + self.config.showType and TableWidgets.Cell{ + children = placement.type + } or nil, + self.config.displayGameIcons and TableWidgets.Cell{ + children = Game.icon{game = placement.game} + } or nil, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tournamentDisplayName + }, + css = {width = '30px'}, + children = LeagueIcon.display{ + icon = placement.icon, + iconDark = placement.icondark, + link = placement.parent, + name = tournamentDisplayName, + options = {noTemplate = true}, + } + }, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tournamentDisplayName + }, + align = 'left', + children = LinkWidget{ + children = tournamentDisplayName, + link = placement.pagename, + } + }, + ( + self.config.playerResultsOfTeam or + self.config.queryType ~= Opponent.team or + Table.isNotEmpty(self.config.aliases) + ) and TableWidgets.Cell{ + align = self.config.hideResult and 'left' or 'right', + attributes = { + ['data-sort-value'] = placement.opponentname + }, + children = self:opponentDisplay( + placement, + {teamForSolo = not self.config.playerResultsOfTeam, flip = not self.config.hideResult} + ) + } or nil, + self:_buildResultCells(placement), + TableWidgets.Cell{children = Currency.display( + 'USD', + useIndivPrize and placement.individualprizemoney or placement.prizemoney, + {dashIfZero = true, displayCurrencyCode = false, formatValue = true} + )} + ) + } +end - if not self.config.hideResult then - local score, vsDisplay, groupAbbr = self:processVsData(placement) - row - :tag('td'):wikitext(score):done() - :tag('td'):css('text-align', 'left'):cssText(groupAbbr and 'padding-left:14px' or nil):node(vsDisplay or groupAbbr) +---@private +---@param placement placement +---@return Widget +ResultsTable._placementToTableCell = FnUtil.memoize(function (placement) + local rawPlacement = Placement.raw(placement.placement or '') + return TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = rawPlacement.sort + }, + classes = {rawPlacement.backgroundClass}, + children = HtmlWidgets.B{ + classes = not rawPlacement.blackText and {'placement-text'} or nil, + children = rawPlacement.display + } + } +end) + +---@private +---@param placement placement +---@return Widget[]? +function ResultsTable:_buildResultCells(placement) + if self.config.hideResult then + return end - - local useIndivPrize = self.config.useIndivPrize and self.config.queryType ~= Opponent.team - row:tag('td'):wikitext(Currency.display('USD', - useIndivPrize and placement.individualprizemoney or placement.prizemoney, - {dashIfZero = true, displayCurrencyCode = false, formatValue = true} - )) - - return row + local score, vsDisplay, groupAbbr = self:processVsData(placement) + return { + TableWidgets.Cell{children = score}, + TableWidgets.Cell{ + align = 'left', + css = {padding = groupAbbr and '14px' or nil}, + children = vsDisplay or groupAbbr + } + } end return ResultsTable From 1ee5e5566a1212fa1d55255b41bc742959d63307 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:26:41 +0900 Subject: [PATCH 14/29] reorganize imports --- lua/wikis/commons/ResultsTable.lua | 6 ++---- lua/wikis/commons/ResultsTable/Award.lua | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index 1292b98e071..f88fce13333 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -7,19 +7,17 @@ local Lua = require('Module:Lua') +local BaseResultsTable = Lua.import('Module:ResultsTable/Base') local Class = Lua.import('Module:Class') local Currency = Lua.import('Module:Currency') local DateExt = Lua.import('Module:Date/Ext') local FnUtil = Lua.import('Module:FnUtil') local Game = Lua.import('Module:Game') local LeagueIcon = Lua.import('Module:LeagueIcon') +local Opponent = Lua.import('Module:Opponent/Custom') local Placement = Lua.import('Module:Placement') local Table = Lua.import('Module:Table') -local BaseResultsTable = Lua.import('Module:ResultsTable/Base') - -local Opponent = Lua.import('Module:Opponent/Custom') - local HtmlWidgets = Lua.import('Module:Widget/Html/All') local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index 9fdc7e68046..2b3460cf925 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -7,15 +7,13 @@ local Lua = require('Module:Lua') +local BaseResultsTable = Lua.import('Module:ResultsTable/Base') local Class = Lua.import('Module:Class') local Currency = Lua.import('Module:Currency') local DateExt = Lua.import('Module:Date/Ext') local LeagueIcon = Lua.import('Module:LeagueIcon') - local Opponent = Lua.import('Module:Opponent/Custom') -local BaseResultsTable = Lua.import('Module:ResultsTable/Base') - local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') local WidgetUtil = Lua.import('Module:Widget/Util') From ef2ca470e9335e0abc233811ce3f815bf261adf6 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:59:22 +0900 Subject: [PATCH 15/29] refactor common cell types --- lua/wikis/commons/ResultsTable.lua | 56 +++-------------- lua/wikis/commons/ResultsTable/Award.lua | 50 ++------------- lua/wikis/commons/ResultsTable/Base.lua | 80 ++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 93 deletions(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index f88fce13333..866ada5f522 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -9,17 +9,13 @@ local Lua = require('Module:Lua') local BaseResultsTable = Lua.import('Module:ResultsTable/Base') local Class = Lua.import('Module:Class') -local Currency = Lua.import('Module:Currency') -local DateExt = Lua.import('Module:Date/Ext') local FnUtil = Lua.import('Module:FnUtil') local Game = Lua.import('Module:Game') -local LeagueIcon = Lua.import('Module:LeagueIcon') local Opponent = Lua.import('Module:Opponent/Custom') local Placement = Lua.import('Module:Placement') local Table = Lua.import('Module:Table') local HtmlWidgets = Lua.import('Module:Widget/Html/All') -local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') local WidgetUtil = Lua.import('Module:Widget/Util') @@ -106,52 +102,17 @@ end ---@param placement table ---@return Html function ResultsTable:buildRow(placement) - local tierDisplay, tierSortValue = self:tierDisplay(placement) - - local tournamentDisplayName = BaseResultsTable.tournamentDisplayName(placement) - - local useIndivPrize = self.config.useIndivPrize and self.config.queryType ~= Opponent.team - return TableWidgets.Row{ highlighted = self:rowHighlight(placement), children = WidgetUtil.collect( - TableWidgets.Cell{children = DateExt.toYmdInUtc(placement.date)}, + self:createDateCell(placement), ResultsTable._placementToTableCell(placement), - TableWidgets.Cell{ - attributes = { - ['data-sort-value'] = tierSortValue - }, - children = tierDisplay - }, - self.config.showType and TableWidgets.Cell{ - children = placement.type - } or nil, + self:createTierCell(placement), + self:createTypeCell(placement), self.config.displayGameIcons and TableWidgets.Cell{ children = Game.icon{game = placement.game} } or nil, - TableWidgets.Cell{ - attributes = { - ['data-sort-value'] = tournamentDisplayName - }, - css = {width = '30px'}, - children = LeagueIcon.display{ - icon = placement.icon, - iconDark = placement.icondark, - link = placement.parent, - name = tournamentDisplayName, - options = {noTemplate = true}, - } - }, - TableWidgets.Cell{ - attributes = { - ['data-sort-value'] = tournamentDisplayName - }, - align = 'left', - children = LinkWidget{ - children = tournamentDisplayName, - link = placement.pagename, - } - }, + self:createTournamentCells(placement), ( self.config.playerResultsOfTeam or self.config.queryType ~= Opponent.team or @@ -167,11 +128,10 @@ function ResultsTable:buildRow(placement) ) } or nil, self:_buildResultCells(placement), - TableWidgets.Cell{children = Currency.display( - 'USD', - useIndivPrize and placement.individualprizemoney or placement.prizemoney, - {dashIfZero = true, displayCurrencyCode = false, formatValue = true} - )} + self:createPrizeCell{ + useIndivPrize = self.config.useIndivPrize and self.config.queryType ~= Opponent.team, + placement = placement + } ) } end diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index 2b3460cf925..0f27cd6ad80 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -9,12 +9,8 @@ local Lua = require('Module:Lua') local BaseResultsTable = Lua.import('Module:ResultsTable/Base') local Class = Lua.import('Module:Class') -local Currency = Lua.import('Module:Currency') -local DateExt = Lua.import('Module:Date/Ext') -local LeagueIcon = Lua.import('Module:LeagueIcon') local Opponent = Lua.import('Module:Opponent/Custom') -local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') local WidgetUtil = Lua.import('Module:Widget/Util') @@ -81,46 +77,13 @@ end ---@param placement placement ---@return Widget function AwardsTable:buildRow(placement) - local tierDisplay, tierSortValue = self:tierDisplay(placement) - - local tournamentDisplayName = BaseResultsTable.tournamentDisplayName(placement) - return TableWidgets.Row{ highlighted = self:rowHighlight(placement), children = WidgetUtil.collect( - TableWidgets.Cell{children = DateExt.toYmdInUtc(placement.date)}, - TableWidgets.Cell{ - attributes = { - ['data-sort-value'] = tierSortValue - }, - children = tierDisplay - }, - self.config.showType and TableWidgets.Cell{ - children = placement.type - } or nil, - TableWidgets.Cell{ - attributes = { - ['data-sort-value'] = tournamentDisplayName - }, - css = {width = '30px'}, - children = LeagueIcon.display{ - icon = placement.icon, - iconDark = placement.icondark, - link = placement.parent, - name = tournamentDisplayName, - options = {noTemplate = true}, - } - }, - TableWidgets.Cell{ - attributes = { - ['data-sort-value'] = tournamentDisplayName - }, - align = 'left', - children = LinkWidget{ - children = tournamentDisplayName, - link = placement.pagename, - } - }, + self:createDateCell(placement), + self:createTierCell(placement), + self:createTypeCell(placement), + self:createTournamentCells(placement), TableWidgets.Cell{children = placement.extradata.award}, (self.config.playerResultsOfTeam or self.config.queryType ~= Opponent.team) and TableWidgets.Cell{ attributes = { @@ -131,10 +94,7 @@ function AwardsTable:buildRow(placement) {teamForSolo = not self.config.playerResultsOfTeam} ) } or nil, - TableWidgets.Cell{children = Currency.display('USD', - self.config.queryType ~= Opponent.team and placement.individualprizemoney or placement.prizemoney, - {dashIfZero = true, displayCurrencyCode = false, formatValue = true} - )} + self:createPrizeCell{placement = placement} ) } end diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 84a67af487f..4fff694db7f 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -10,9 +10,12 @@ local Lua = require('Module:Lua') local Abbreviation = Lua.import('Module:Abbreviation') local Array = Lua.import('Module:Array') local Class = Lua.import('Module:Class') +local Currency = Lua.import('Module:Currency') +local DateExt = Lua.import('Module:Date/Ext') local Game = Lua.import('Module:Game') local HighlightConditions = Lua.import('Module:HighlightConditions') local Info = Lua.import('Module:Info', {loadData = true}) +local LeagueIcon = Lua.import('Module:LeagueIcon') local Logic = Lua.import('Module:Logic') local Namespace = Lua.import('Module:Namespace') local String = Lua.import('Module:StringUtils') @@ -594,4 +597,81 @@ function BaseResultsTable:buildRow(placement) error('BaseResultsTable:buildRow() cannot be called directly and must be overridden.') end +---@protected +---@param placement placement +---@return Widget +function BaseResultsTable:createDateCell(placement) + return TableWidgets.Cell{children = DateExt.toYmdInUtc(placement.date)} +end + +---@protected +---@param placement placement +---@return Widget +function BaseResultsTable:createTierCell(placement) + local tierDisplay, tierSortValue = self:tierDisplay(placement) + return TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tierSortValue + }, + children = tierDisplay + } +end + +---@protected +---@param placement placement +---@return Widget? +function BaseResultsTable:createTypeCell(placement) + if not self.config.showType then + return + end + return TableWidgets.Cell{ + children = placement.type + } +end + +---@protected +---@param placement placement +---@return Widget[] +function BaseResultsTable:createTournamentCells(placement) + local tournamentDisplayName = BaseResultsTable.tournamentDisplayName(placement) + return { + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tournamentDisplayName + }, + css = {width = '30px'}, + children = LeagueIcon.display{ + icon = placement.icon, + iconDark = placement.icondark, + link = placement.parent, + name = tournamentDisplayName, + options = {noTemplate = true}, + } + }, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = tournamentDisplayName + }, + align = 'left', + children = LinkWidget{ + children = tournamentDisplayName, + link = placement.pagename, + } + }, + } +end + +---@protected +---@param props {useIndivPrize: boolean?, placement: placement} +---@return Widget +function BaseResultsTable:createPrizeCell(props) + local useIndivPrize = Logic.nilOr(props.useIndivPrize, self.config.queryType ~= Opponent.team) + local placement = props.placement + return TableWidgets.Cell{children = Currency.display( + 'USD', + useIndivPrize and placement.individualprizemoney or placement.prizemoney, + {dashIfZero = true, displayCurrencyCode = false, formatValue = true} + )} +end + return BaseResultsTable From 6dabcedb8e3d2bc9716886f1779c4106cada73f9 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:14:08 +0900 Subject: [PATCH 16/29] type annotation --- lua/wikis/commons/ResultsTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index 866ada5f522..51f2d94067a 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -99,7 +99,7 @@ function ResultsTable:buildHeader() end ---Builds a placement row of the results/achievements table ----@param placement table +---@param placement placement ---@return Html function ResultsTable:buildRow(placement) return TableWidgets.Row{ From f0f0651ceb26057f1034e58c5d5f81fafd01e5e6 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:16:00 +0900 Subject: [PATCH 17/29] use Opponent.isType --- lua/wikis/commons/ResultsTable/Base.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 4fff694db7f..064a39898e6 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -463,7 +463,7 @@ end function BaseResultsTable:opponentDisplay(data, options) options = options or {} - if not data.opponenttype then + if not Opponent.isType(data.opponenttype) then return '-' elseif data.opponenttype ~= Opponent.team and (data.opponenttype ~= Opponent.solo or not options.teamForSolo) then return OpponentDisplay.BlockOpponent{ From ade1eefed47826f379c213bf1fbb9070c9a5f7a4 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:17:28 +0900 Subject: [PATCH 18/29] replace html code with html entity --- lua/wikis/commons/ResultsTable/Base.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 064a39898e6..0402a8485d0 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -55,7 +55,7 @@ local QUERY_TYPES = { team = 'team', coach = 'coach', } -local SCORE_CONCAT = ' : ' +local SCORE_CONCAT = ' : ' local DEFAULT_RESULTS_SUB_PAGE = 'Results' local INVALID_TIER_DISPLAY = 'Undefined' local INVALID_TIER_SORT = 'ZZ' From aeabe8f034e0a8cb5b57953f7826f67e3851b9f3 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:17:45 +0900 Subject: [PATCH 19/29] reorder imports --- lua/wikis/commons/ResultsTable/Base.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 0402a8485d0..d3514c4dc46 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -18,14 +18,13 @@ local Info = Lua.import('Module:Info', {loadData = true}) local LeagueIcon = Lua.import('Module:LeagueIcon') local Logic = Lua.import('Module:Logic') local Namespace = Lua.import('Module:Namespace') +local Opponent = Lua.import('Module:Opponent/Custom') +local OpponentDisplay = Lua.import('Module:OpponentDisplay/Custom') local String = Lua.import('Module:StringUtils') local Table = Lua.import('Module:Table') local TeamTemplate = Lua.import('Module:TeamTemplate') local Tier = Lua.import('Module:Tier/Custom') -local Opponent = Lua.import('Module:Opponent/Custom') -local OpponentDisplay = Lua.import('Module:OpponentDisplay/Custom') - local Condition = Lua.import('Module:Condition') local ConditionTree = Condition.Tree local ConditionNode = Condition.Node From 0054576d463ec767f522e5afd6685095ba518ec8 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:39:17 +0900 Subject: [PATCH 20/29] type annotations --- lua/wikis/commons/ResultsTable/Custom.lua | 4 ++-- lua/wikis/counterstrike/ResultsTable/Custom.lua | 4 ++-- lua/wikis/fortnite/ResultsTable/Custom.lua | 4 ++-- lua/wikis/starcraft2/ResultsTable/Custom.lua | 4 ++-- lua/wikis/trackmania/ResultsTable/Custom.lua | 4 ++++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Custom.lua b/lua/wikis/commons/ResultsTable/Custom.lua index 37dab73bdb3..88980d94508 100644 --- a/lua/wikis/commons/ResultsTable/Custom.lua +++ b/lua/wikis/commons/ResultsTable/Custom.lua @@ -16,14 +16,14 @@ local CustomResultsTable = {} -- Template entry point for results and achievements tables ---@param args table ----@return Html +---@return Widget function CustomResultsTable.results(args) return ResultsTable(args):create():build() end -- Template entry point for awards tables ---@param args table ----@return Html +---@return Widget function CustomResultsTable.awards(args) return AwardsTable(args):create():build() end diff --git a/lua/wikis/counterstrike/ResultsTable/Custom.lua b/lua/wikis/counterstrike/ResultsTable/Custom.lua index 18f2ffaca8e..07fce7fc3f6 100644 --- a/lua/wikis/counterstrike/ResultsTable/Custom.lua +++ b/lua/wikis/counterstrike/ResultsTable/Custom.lua @@ -21,7 +21,7 @@ local CustomResultsTable = {} -- Template entry point for results and achievements tables ---@param args table ----@return Html +---@return Widget function CustomResultsTable.results(args) args.gameIcons = true args.showType = true @@ -34,7 +34,7 @@ end -- Template entry point for awards tables ---@param args table ----@return Html +---@return Widget function CustomResultsTable.awards(args) args.gameIcons = true args.showType = true diff --git a/lua/wikis/fortnite/ResultsTable/Custom.lua b/lua/wikis/fortnite/ResultsTable/Custom.lua index 3ab2bff2aca..b0c055a7c0a 100644 --- a/lua/wikis/fortnite/ResultsTable/Custom.lua +++ b/lua/wikis/fortnite/ResultsTable/Custom.lua @@ -21,7 +21,7 @@ local CustomResultsTable = {} -- Template entry point ---@param args table ----@return Html +---@return Widget function CustomResultsTable.results(args) local resultsTable = ResultsTable(args) @@ -33,7 +33,7 @@ function CustomResultsTable.results(args) end ---@param args table ----@return Html +---@return Widget function CustomResultsTable.awards(args) return AwardsTable(args):create():build() end diff --git a/lua/wikis/starcraft2/ResultsTable/Custom.lua b/lua/wikis/starcraft2/ResultsTable/Custom.lua index 10930b82a51..b8e5d4710de 100644 --- a/lua/wikis/starcraft2/ResultsTable/Custom.lua +++ b/lua/wikis/starcraft2/ResultsTable/Custom.lua @@ -31,7 +31,7 @@ local CustomResultsTable = {} -- Template entry point ---@param frame Frame ----@return Html? +---@return Widget? function CustomResultsTable.results(frame) local args = Arguments.getArgs(frame) args.useIndivPrize = true @@ -54,7 +54,7 @@ end -- Template entry point for awards ---@param frame Frame ----@return Html? +---@return Widget? function CustomResultsTable.awards(frame) local args = Arguments.getArgs(frame) args.useIndivPrize = true diff --git a/lua/wikis/trackmania/ResultsTable/Custom.lua b/lua/wikis/trackmania/ResultsTable/Custom.lua index 309ae06ce54..ccd192d3514 100644 --- a/lua/wikis/trackmania/ResultsTable/Custom.lua +++ b/lua/wikis/trackmania/ResultsTable/Custom.lua @@ -15,12 +15,16 @@ local AwardsTable = Lua.import('Module:ResultsTable/Award') local CustomResultsTable = {} -- Template entry point for results and achievements tables +---@param args table +---@return Widget function CustomResultsTable.results(args) args.hideresult = true return ResultsTable(args):create():build() end -- Template entry point for awards tables +---@param args table +---@return Widget function CustomResultsTable.awards(args) return AwardsTable(args):create():build() end From 97caacd1061f47d939dac4448442ac4a4583cddb Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:15:35 +0900 Subject: [PATCH 21/29] tune column defs --- lua/wikis/commons/ResultsTable.lua | 18 +++++++++++++----- lua/wikis/commons/ResultsTable/Award.lua | 20 ++++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index 51f2d94067a..d6c76f0020f 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -27,6 +27,8 @@ function ResultsTable:buildColumnDefinitions() return WidgetUtil.collect( { align = 'center', + nowrap = true, + shrink = true, sortType = 'isoDate', }, { @@ -34,8 +36,10 @@ function ResultsTable:buildColumnDefinitions() minWidth = '80px', }, { - align = 'center', - minWidth = '75px', + align = 'left', + minWidth = '4.5rem', + nowrap = true, + shrink = true, }, self.config.showType and { align = 'center', @@ -44,8 +48,12 @@ function ResultsTable:buildColumnDefinitions() self.config.displayGameIcons and { align = 'center' } or nil, - {align = 'center'}, - {align = 'center'}, + {align = 'left'}, + { + align = 'left', + shrink = true, + nowrap = true, + }, (self.config.queryType ~= Opponent.team or Table.isNotEmpty(self.config.aliases)) and { align = 'center', minWidth = '70px', @@ -64,7 +72,7 @@ function ResultsTable:buildColumnDefinitions() }, } or nil, { - align = 'center', + align = 'right', sortType = 'currency', } ) diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index 0f27cd6ad80..abafc117cf3 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -22,20 +22,28 @@ function AwardsTable:buildColumnDefinitions() return WidgetUtil.collect( { align = 'center', + nowrap = true, + shrink = true, sortType = 'isoDate', }, { - align = 'center', - minWidth = '75px', + align = 'left', + minWidth = '4.5rem', + nowrap = true, + shrink = true, }, self.config.showType and { align = 'center', minWidth = '50px', } or nil, - {align = 'center'}, - {align = 'center'}, + {align = 'left'}, { - align = 'center', + align = 'left', + shrink = true, + nowrap = true, + }, + { + align = 'left', minWidth = '225px', }, self.config.queryType ~= Opponent.team and { @@ -46,7 +54,7 @@ function AwardsTable:buildColumnDefinitions() minWidth = '105px', } or nil, { - align = 'center', + align = 'right', sortType = 'currency', } ) From a9fb0d622ef93e71ff51d45511841881a8f1c751 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:16:09 +0900 Subject: [PATCH 22/29] type anno --- lua/wikis/commons/ResultsTable.lua | 2 ++ lua/wikis/commons/ResultsTable/Award.lua | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index d6c76f0020f..ebba47c4c44 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -23,6 +23,8 @@ local WidgetUtil = Lua.import('Module:Widget/Util') ---@operator call(table): ResultsTable local ResultsTable = Class.new(BaseResultsTable) +---@protected +---@return table[] function ResultsTable:buildColumnDefinitions() return WidgetUtil.collect( { diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index abafc117cf3..7fc3d142626 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -18,6 +18,8 @@ local WidgetUtil = Lua.import('Module:Widget/Util') ---@operator call(table): AwardsTable local AwardsTable = Class.new(BaseResultsTable) +---@protected +---@return table[] function AwardsTable:buildColumnDefinitions() return WidgetUtil.collect( { From b78fad901f6ff3e96e2fe167608bf990e6e7e6f6 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:53:35 +0900 Subject: [PATCH 23/29] reduce include size a bit --- lua/wikis/commons/ResultsTable/Base.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index d3514c4dc46..d9fe323cbd9 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -638,7 +638,6 @@ function BaseResultsTable:createTournamentCells(placement) attributes = { ['data-sort-value'] = tournamentDisplayName }, - css = {width = '30px'}, children = LeagueIcon.display{ icon = placement.icon, iconDark = placement.icondark, @@ -651,7 +650,6 @@ function BaseResultsTable:createTournamentCells(placement) attributes = { ['data-sort-value'] = tournamentDisplayName }, - align = 'left', children = LinkWidget{ children = tournamentDisplayName, link = placement.pagename, From 80713ae87c0d5afde05bba3ffb184de9b41f409b Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:28:04 +0900 Subject: [PATCH 24/29] adjust column definitions Co-authored-by: Eetu Rantanen <75437856+Eetwalt@users.noreply.github.com> --- lua/wikis/commons/ResultsTable.lua | 39 ++++++------------------ lua/wikis/commons/ResultsTable/Award.lua | 25 +++------------ 2 files changed, 13 insertions(+), 51 deletions(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index ebba47c4c44..d6d5a332fa2 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -27,50 +27,29 @@ local ResultsTable = Class.new(BaseResultsTable) ---@return table[] function ResultsTable:buildColumnDefinitions() return WidgetUtil.collect( - { - align = 'center', - nowrap = true, - shrink = true, - sortType = 'isoDate', - }, - { - align = 'center', - minWidth = '80px', - }, { align = 'left', - minWidth = '4.5rem', - nowrap = true, - shrink = true, + sortType = 'isoDate', }, - self.config.showType and { - align = 'center', - minWidth = '50px', - } or nil, - self.config.displayGameIcons and { - align = 'center' - } or nil, + {align = 'center'}, + {align = 'left'}, + self.config.showType and {align = 'center'} or nil, + self.config.displayGameIcons and {align = 'center'} or nil, + {align = 'left'}, {align = 'left'}, - { - align = 'left', - shrink = true, - nowrap = true, - }, (self.config.queryType ~= Opponent.team or Table.isNotEmpty(self.config.aliases)) and { align = 'center', - minWidth = '70px', } or self.config.playerResultsOfTeam and { align = 'center', - minWidth = '105px', } or nil, not self.config.hideResult and { { - align = 'center', - sortable = false, + align = 'left', + unsortable = true, }, { align = 'center', - sortable = false, + unsortable = true, }, } or nil, { diff --git a/lua/wikis/commons/ResultsTable/Award.lua b/lua/wikis/commons/ResultsTable/Award.lua index 7fc3d142626..0fef02e38f7 100644 --- a/lua/wikis/commons/ResultsTable/Award.lua +++ b/lua/wikis/commons/ResultsTable/Award.lua @@ -22,38 +22,21 @@ local AwardsTable = Class.new(BaseResultsTable) ---@return table[] function AwardsTable:buildColumnDefinitions() return WidgetUtil.collect( - { - align = 'center', - nowrap = true, - shrink = true, - sortType = 'isoDate', - }, { align = 'left', - minWidth = '4.5rem', - nowrap = true, - shrink = true, + sortType = 'isoDate', }, + {align = 'left'}, self.config.showType and { align = 'center', - minWidth = '50px', } or nil, {align = 'left'}, - { - align = 'left', - shrink = true, - nowrap = true, - }, - { - align = 'left', - minWidth = '225px', - }, + {align = 'left'}, + {align = 'left'}, self.config.queryType ~= Opponent.team and { align = 'center', - minWidth = '70px', } or self.config.playerResultsOfTeam and { align = 'center', - minWidth = '105px', } or nil, { align = 'right', From 0936f723ee3abbe7b161c1ea5c38e45375089ffe Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:32:15 +0900 Subject: [PATCH 25/29] this actually should be centered --- lua/wikis/commons/ResultsTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index d6d5a332fa2..1fc0c31a7f5 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -44,7 +44,7 @@ function ResultsTable:buildColumnDefinitions() } or nil, not self.config.hideResult and { { - align = 'left', + align = 'center', unsortable = true, }, { From 33cd6d4a60b702a5a59858d4905d0055bbd88815 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:36:34 +0900 Subject: [PATCH 26/29] override header alignment --- lua/wikis/commons/ResultsTable.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index 1fc0c31a7f5..6ab0c54a806 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -80,6 +80,7 @@ function ResultsTable:buildHeader() children = 'Player' } or nil, not self.config.hideResult and TableWidgets.CellHeader{ + align = 'left', colspan = 2, children = 'Result' } or nil, From 0b32defca75873d5536ac8fa7f2df048a928db34 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:39:22 +0900 Subject: [PATCH 27/29] adjust footer styling Co-authored-by: Eetu Rantanen <75437856+Eetwalt@users.noreply.github.com> --- lua/wikis/commons/ResultsTable/Base.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index d9fe323cbd9..4eaad934821 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -384,10 +384,10 @@ function BaseResultsTable:build() } or nil, TableWidgets.TableBody{children = WidgetUtil.collect(self:_buildTableBody(), self.args.manualContent)} ), - footer = self.config.onlyAchievements and HtmlWidgets.I{children = LinkWidget{ + footer = self.config.onlyAchievements and LinkWidget{ link = self.config.opponent .. '/' .. self.config.resultsSubPage, children = 'Extended list of results', - }} or nil + } or nil } end From 9546d6bff589a2623ad35ca2d84b549e12ed5006 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Wed, 25 Feb 2026 20:46:12 +0900 Subject: [PATCH 28/29] use subheader --- lua/wikis/commons/ResultsTable/Base.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/wikis/commons/ResultsTable/Base.lua b/lua/wikis/commons/ResultsTable/Base.lua index 4eaad934821..9a52f3d8c63 100644 --- a/lua/wikis/commons/ResultsTable/Base.lua +++ b/lua/wikis/commons/ResultsTable/Base.lua @@ -413,6 +413,7 @@ function BaseResultsTable:_buildRows(placementData) if placementData.header then table.insert(rows, TableWidgets.Row{ + section = 'subhead', classes = {'sortbottom'}, css = {['font-weight'] = 'bold'}, children = TableWidgets.CellHeader{ From 47617be5cf8364a2a015b5b46edfb49ea2ccef1f Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:18:06 +0900 Subject: [PATCH 29/29] use new placement badges --- lua/wikis/commons/ResultsTable.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lua/wikis/commons/ResultsTable.lua b/lua/wikis/commons/ResultsTable.lua index 6ab0c54a806..fb026fdd09a 100644 --- a/lua/wikis/commons/ResultsTable.lua +++ b/lua/wikis/commons/ResultsTable.lua @@ -96,7 +96,7 @@ function ResultsTable:buildRow(placement) highlighted = self:rowHighlight(placement), children = WidgetUtil.collect( self:createDateCell(placement), - ResultsTable._placementToTableCell(placement), + ResultsTable._placementToTableCell(placement.placement), self:createTierCell(placement), self:createTypeCell(placement), self.config.displayGameIcons and TableWidgets.Cell{ @@ -127,19 +127,15 @@ function ResultsTable:buildRow(placement) end ---@private ----@param placement placement +---@param placement string ---@return Widget ResultsTable._placementToTableCell = FnUtil.memoize(function (placement) - local rawPlacement = Placement.raw(placement.placement or '') + local rawPlacement = Placement.raw(placement or '') return TableWidgets.Cell{ attributes = { ['data-sort-value'] = rawPlacement.sort }, - classes = {rawPlacement.backgroundClass}, - children = HtmlWidgets.B{ - classes = not rawPlacement.blackText and {'placement-text'} or nil, - children = rawPlacement.display - } + children = Placement.renderInWidget{placement = placement} } end)