From a4f128de997e9bf9d95bd786b4226578fba448ea Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sat, 14 Feb 2026 14:55:24 +0100 Subject: [PATCH 01/17] add Wrapper --- lua/wikis/commons/Widget/EmptyPagePreview.lua | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lua/wikis/commons/Widget/EmptyPagePreview.lua diff --git a/lua/wikis/commons/Widget/EmptyPagePreview.lua b/lua/wikis/commons/Widget/EmptyPagePreview.lua new file mode 100644 index 00000000000..2f7c1ef222a --- /dev/null +++ b/lua/wikis/commons/Widget/EmptyPagePreview.lua @@ -0,0 +1,36 @@ +--- +-- @Liquipedia +-- page=Module:Widget/EmptyPagePreview +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local Lua = require('Module:Lua') + +local Class = require('Module:Class') +local Namespace = Lua.import('Module:Namespace') +local TeamTemplate = Lua.import('Module:TeamTemplate') + +local EmptyTeamPagePreview = Lua.import('Module:Widget/EmptyPagePreview/Team') +local EmptyPersonPagePreview = Lua.import('Module:Widget/EmptyPagePreview/Person') +local Widget = require('Module:Widget') + +---@class EmptyPagePreview: Widget +---@operator call(table): EmptyPagePreview +local EmptyPagePreview = Class.new(Widget) + + +---@return Widget? +function EmptyPagePreview:render() + if not Namespace.isMain() then + return + end + + if TeamTemplate.exists(self.props.pageName or mw.title.getCurrentTitle().prefixedText) then + return EmptyTeamPagePreview(self.props) + end + + return EmptyPersonPagePreview(self.props) +end + +return EmptyTeamPagePreview \ No newline at end of file From a4339b34ef4945d7bb71103b597a99a0dd4cd6eb Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sat, 14 Feb 2026 14:57:17 +0100 Subject: [PATCH 02/17] eof --- lua/wikis/commons/Widget/EmptyPagePreview.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview.lua b/lua/wikis/commons/Widget/EmptyPagePreview.lua index 2f7c1ef222a..e7c7a24cd06 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview.lua @@ -33,4 +33,4 @@ function EmptyPagePreview:render() return EmptyPersonPagePreview(self.props) end -return EmptyTeamPagePreview \ No newline at end of file +return EmptyTeamPagePreview From 6a0baea027dede26086fa2ca09c9e698a7e25d44 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sat, 14 Feb 2026 17:49:46 +0100 Subject: [PATCH 03/17] prep custom infoboxes (alias faction for race) --- lua/wikis/starcraft/Infobox/Person/Player/Custom.lua | 8 ++++---- lua/wikis/starcraft2/Infobox/Person/Custom.lua | 4 ++-- lua/wikis/starcraft2/Infobox/Person/MapMaker/Custom.lua | 2 +- lua/wikis/starcraft2/Infobox/Person/Player/Custom.lua | 4 ++-- lua/wikis/warcraft/Infobox/Person/Player/Custom.lua | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lua/wikis/starcraft/Infobox/Person/Player/Custom.lua b/lua/wikis/starcraft/Infobox/Person/Player/Custom.lua index c9abd827ee1..23692ebc1c9 100644 --- a/lua/wikis/starcraft/Infobox/Person/Player/Custom.lua +++ b/lua/wikis/starcraft/Infobox/Person/Player/Custom.lua @@ -94,7 +94,7 @@ function CustomInjector:parse(id, widgets) return { Cell{ name = 'Race', - children = {CustomPlayer._getRaceDisplay(args.race)} + children = {CustomPlayer._getRaceDisplay(args.race or args.faction)} } } elseif id == 'role' then return {} @@ -148,7 +148,7 @@ end ---@param args table ---@return string function CustomPlayer:nameDisplay(args) - local factions = Faction.readMultiFaction(args.race or Faction.defaultFaction, {alias = false}) + local factions = Faction.readMultiFaction(args.race or args.faction or Faction.defaultFaction, {alias = false}) local raceIcons = table.concat(Array.map(factions, function(faction) return Faction.Icon{faction = faction, size = 'medium'} @@ -176,7 +176,7 @@ end function CustomPlayer:adjustLPDB(lpdbData, args, personType) local extradata = lpdbData.extradata or {} - local factions = Faction.readMultiFaction(args.race, {alias = false}) + local factions = Faction.readMultiFaction(args.race or args.faction, {alias = false}) extradata.race = factions[1] extradata.faction = Faction.toName(factions[1]) @@ -517,7 +517,7 @@ function CustomPlayer:getWikiCategories(categories) table.insert(categories, 'Foreign Players') end - for _, faction in pairs(Faction.readMultiFaction(args.race, {alias = false})) do + for _, faction in pairs(Faction.readMultiFaction(args.race or args.faction, {alias = false})) do table.insert(categories, Faction.toName(faction) .. ' Players') end diff --git a/lua/wikis/starcraft2/Infobox/Person/Custom.lua b/lua/wikis/starcraft2/Infobox/Person/Custom.lua index 766b0ce7a2c..0baf65839a1 100644 --- a/lua/wikis/starcraft2/Infobox/Person/Custom.lua +++ b/lua/wikis/starcraft2/Infobox/Person/Custom.lua @@ -55,7 +55,7 @@ end ---@param args table ---@return string function CustomPerson:nameDisplay(args) - local raceData = self:readFactions(args.race or Faction.defaultFaction) + local raceData = self:readFactions(args.race or args.faction or Faction.defaultFaction) local raceIcons if raceData.isAll then @@ -109,7 +109,7 @@ end function CustomPerson:adjustLPDB(lpdbData, args, personType) local extradata = lpdbData.extradata or {} - local raceData = self:readFactions(args.race) + local raceData = self:readFactions(args.race or args.faction) extradata.race = raceData.isAll and RACE_ALL_SHORT or raceData.factions[1] extradata.faction = raceData.isAll and RACE_ALL or raceData.factions[1] diff --git a/lua/wikis/starcraft2/Infobox/Person/MapMaker/Custom.lua b/lua/wikis/starcraft2/Infobox/Person/MapMaker/Custom.lua index 887cfef37fb..02eb1263731 100644 --- a/lua/wikis/starcraft2/Infobox/Person/MapMaker/Custom.lua +++ b/lua/wikis/starcraft2/Infobox/Person/MapMaker/Custom.lua @@ -45,7 +45,7 @@ function CustomInjector:parse(id, widgets) return { Cell{ name = 'Race', - children = {self.caller:getRaceData(args.race)} + children = {self.caller:getRaceData(args.race or args.faction)} } } elseif id == 'role' then return {} diff --git a/lua/wikis/starcraft2/Infobox/Person/Player/Custom.lua b/lua/wikis/starcraft2/Infobox/Person/Player/Custom.lua index 720dbb91ff9..5e3699ab1cf 100644 --- a/lua/wikis/starcraft2/Infobox/Person/Player/Custom.lua +++ b/lua/wikis/starcraft2/Infobox/Person/Player/Custom.lua @@ -119,7 +119,7 @@ function CustomInjector:parse(id, widgets) return { Cell{ name = 'Race', - children = {caller:getRaceData(args.race, RACE_FIELD_AS_CATEGORY_LINK)} + children = {caller:getRaceData(args.race or args.faction, RACE_FIELD_AS_CATEGORY_LINK)} } } elseif id == 'role' then return {} @@ -502,7 +502,7 @@ end ---@param categories string[] ---@return string[] function CustomPlayer:getWikiCategories(categories) - for _, faction in pairs(self:readFactions(self.args.race).factions) do + for _, faction in pairs(self:readFactions(self.args.race or self.args.faction).factions) do table.insert(categories, faction .. ' Players') end diff --git a/lua/wikis/warcraft/Infobox/Person/Player/Custom.lua b/lua/wikis/warcraft/Infobox/Person/Player/Custom.lua index 156da2d1b4f..553cb14bb95 100644 --- a/lua/wikis/warcraft/Infobox/Person/Player/Custom.lua +++ b/lua/wikis/warcraft/Infobox/Person/Player/Custom.lua @@ -65,7 +65,7 @@ function CustomInjector:parse(id, widgets) elseif id == 'role' then -- WC doesn't show any roles, but rather shows the Race/Faction instead return { - Cell{name = 'Race', children = {Faction.toName(args.race)}} + Cell{name = 'Race', children = {Faction.toName(args.race or args.faction)}} } end return widgets @@ -76,7 +76,7 @@ end ---@param personType string ---@return table function CustomPlayer:adjustLPDB(lpdbData, args, personType) - lpdbData.extradata.faction = Faction.toName(args.race) + lpdbData.extradata.faction = Faction.toName(args.race or args.faction) lpdbData.extradata.factionhistorical = Variables.varDefault('racecount') and 'true' or 'false' return lpdbData @@ -85,7 +85,7 @@ end ---@param args table ---@return string function CustomPlayer:nameDisplay(args) - local factionIcon = Faction.Icon{faction = args.race} + local factionIcon = Faction.Icon{faction = args.race or args.faction} return (factionIcon and (factionIcon .. NON_BREAKING_SPACE) or '') .. (args.id or self.pagename) From b17a93abd9a21f6ffcc860aea4971a3164bc7f1a Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sat, 14 Feb 2026 19:17:46 +0100 Subject: [PATCH 04/17] implement empty page for persosn --- .../Widget/EmptyPagePreview/Person.lua | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 lua/wikis/commons/Widget/EmptyPagePreview/Person.lua diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua new file mode 100644 index 00000000000..d7debdc910e --- /dev/null +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -0,0 +1,265 @@ +--- +-- @Liquipedia +-- page=Module:Widget/EmptyPagePreview/Person +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local Lua = require('Module:Lua') + +local Array = Lua.import('Module:Array') +local BroadcasterTable = Lua.import('Module:BroadcastTalentTable') +local Class = Lua.import('Module:Class') +local DateExt = Lua.import('Module:Date/Ext') +local Game = Lua.import('Module:Game') +local Info = Lua.import('Module:Info', {loadData = true}) +local Infobox = Lua.import('Module:Infobox/Person/Player/Custom') +local Logic = Lua.import('Module:Logic') +local MatchTable = Lua.import('Module:MatchTable/Custom') +local Namespace = Lua.import('Module:Namespace') +local Page = Lua.import('Module:Page') +local ResultsTable = Lua.import('Module:ResultsTable/Custom') +local Table = Lua.import('Module:Table') +local Tabs = Lua.import('Module:Tabs') +local Variables = Lua.import('Module:Variables') + +local PlayerAutoTeamNavBox = Lua.import('Module:Widget/NavBox/AutoTeam/Player') +local HtmlWidgets = Lua.import('Module:Widget/Html/All') +local Widget = Lua.import('Module:Widget') +local WidgetUtil = Lua.import('Module:Widget/Util') + +local Condition = Lua.import('Module:Condition') +local ConditionTree = Condition.Tree +local ConditionNode = Condition.Node +local Comparator = Condition.Comparator +local BooleanOperator = Condition.BooleanOperator +local ColumnName = Condition.ColumnName + +local DEFAULT_MAX_PLAYERS_PER_PLACEMENT = Info.config.defaultMaxPlayersPerPlacement or 10 + +---@class EmptyPersonPagePreview: Widget +---@operator call(table): EmptyPersonPagePreview +local EmptyPersonPagePreview = Class.new(Widget) +EmptyPersonPagePreview.defaultProps = {pageName = mw.title.getCurrentTitle().prefixedText} + +---@return Widget? +function EmptyPersonPagePreview:render() + if not Namespace.isMain() then + return + end + + --disable storage ... just to be sure ... + Variables.varDefine('disable_LPDB_storage', 'true') + + self.person = Page.applyUnderScoresIfEnforced(self.props.pageName) + + return HtmlWidgets.Div{ + children = WidgetUtil.collect( + self:_infobox(), + HtmlWidgets.H2{children = {'Overview'}}, + self:_results(), + self:_matches(), + HtmlWidgets.Br{}, + PlayerAutoTeamNavBox{} + ), + } +end + +---@private +---@return Widget +function EmptyPersonPagePreview:_infobox() + local infoboxArgsFromSquadInfo = self:_backfillInformationFromSquadInfo() + + local infoboxArgs = Table.merge( + { + wiki = self:_getWiki(), + default = 'Infobox player NoImage.png', + defaultDark = 'Infobox player NoImage darkmode.png', + }, + infoboxArgsFromSquadInfo, + self:_backfillInformationFromPlacements() + ) + table.insert(infoboxArgs.idsArray, infoboxArgsFromSquadInfo.id) + infoboxArgs.idsArray = Array.unique(infoboxArgs.idsArray) + infoboxArgs.idsArray = Array.filter(infoboxArgs.idsArray, function(id) + return id ~= infoboxArgs.id + end) + infoboxArgs.ids = table.concat(infoboxArgs.idsArray, ', ') + infoboxArgs.id = infoboxArgs.id or self.person:gsub('_', ' ') + + return Infobox.run(infoboxArgs) +end + +---@return string? +function EmptyPersonPagePreview:_getWiki() + if Logic.isNotEmpty(self.props.wiki) then + return self.props.wiki + end + if Logic.isNotEmpty(self.props.game) then + return Game.toIdentifier{game = self.props.game} or self.props.game + end +end + +---@private +---@return (Widget|Html)[] +function EmptyPersonPagePreview:_matches() + return { + HtmlWidgets.H3{children = 'Most Recent Matches'}, + MatchTable.results{ + tableMode = 'solo', + player = self.person, + showType = true, + limit = 10, + } + } +end + +---@private +---@return (Widget|Html)[] +function EmptyPersonPagePreview:_results() + ---@type table + local tabArgs = { + suppressHeader = true, + name1 = 'Achievements', + content1 = tostring(ResultsTable.results{ + player = self.person, + showType = true, + gameIcons = true, + awards = false, + achievements = true, + playerResultsOfTeam = false, + querytype = 'team', + }) + } + local index = 2 + + local awardsAchievements = ResultsTable.awards{ + player = self.person, + showType = true, + gameIcons = true, + awards = true, + achievements = true, + playerResultsOfTeam = false, + querytype = 'team', + } + if Logic.isNotEmpty(awardsAchievements) then + tabArgs['name' .. index] = 'Awards Achievements' + tabArgs['content' .. index] = tostring(awardsAchievements) + index = index + 1 + end + + local talentAchievements = BroadcasterTable.run{ + broadcaster = self.person, + achievements = 1, + aboutAchievementsLink = 'Template:Broadcast talent achievements table/doc', + useTickerNames = true, + } + if Logic.isNotEmpty(talentAchievements) then + tabArgs['name' .. index] = 'Talent Achievements' + tabArgs['content' .. index] = tostring(talentAchievements) + end + + return { + HtmlWidgets.H3{children = 'Achievements'}, + tostring(Tabs.dynamic(tabArgs)) + } +end + +--- checks the last 100 placements for the wanted data +---@private +---@return table +function EmptyPersonPagePreview:_backfillInformationFromPlacements() + local personConditions = ConditionTree(BooleanOperator.any) + -- players + :add(Array.map(Array.range(1, DEFAULT_MAX_PLAYERS_PER_PLACEMENT), function(index) + return ConditionNode(ColumnName('p' .. index, 'opponentplayers'), Comparator.eq, self.person) + end)) + -- coaches (etc) + :add(Array.map(Array.range(1, 5), function(index) + return ConditionNode(ColumnName('c' .. index, 'opponentplayers'), Comparator.eq, self.person) + end)) + + local conditions = ConditionTree(BooleanOperator.all):add{ + ConditionNode(ColumnName('date'), Comparator.neq, DateExt.defaultDateTime), + ConditionNode(ColumnName('opponentplayers'), Comparator.neq, ''), + ConditionNode(ColumnName('opponentplayers'), Comparator.neq, '[]'), + ConditionNode(ColumnName('liquipediatier'), Comparator.neq, -1), + personConditions + } + + local placements = mw.ext.LiquipediaDB.lpdb('placement', { + conditions = tostring(conditions), + query = 'opponenttype, opponentname, opponenttemplate, opponentplayers', + order = 'date desc', + limit = 100, + }) + + local infoboxArgs = {idsArray = {}} + + if #placements == 0 then + return infoboxArgs + end + + ---@param personData table + ---@return string? + local getPersonPrefix = function(personData) + local index = 1 + while personData['p' .. index] or personData['c' .. index] do + if personData['p' .. index] == self.person then + return 'p' .. index + end + if personData['c' .. index] == self.person then + return 'c' .. index + end + index = index + 1 + end + end + + Array.forEach(Array.reverse(placements), function(placement) + -- can not use Opponent.fromLpdbStruct because it only converts players not coaches + local prefix = getPersonPrefix(placement.opponentplayers) + if not prefix then + return + end + + local id = Logic.nilIfEmpty(placement.opponentplayers[prefix .. 'dn']) + table.insert(infoboxArgs.idsArray, id) + Table.mergeInto(infoboxArgs, { + id = id, + country = Logic.nilIfEmpty(placement.opponentplayers[prefix .. 'flag']), + faction = Logic.nilIfEmpty(placement.opponentplayers[prefix .. 'faction']), + }) + end) + + return infoboxArgs +end + +---@private +---@return table +function EmptyPersonPagePreview:_backfillInformationFromSquadInfo() + local squadEntry = mw.ext.LiquipediaDB.lpdb('squadplayer', { + conditions = tostring(ConditionNode(ColumnName('link'), Comparator.eq, self.person)), + query = 'name, id, nationality, leavedate, inactivedate, pagename, extradata', + order = 'joindate desc', + limit = 1, + })[1] + + if not squadEntry then + return {} + end + + local infoboxArgs = { + id = Logic.nilIfEmpty(squadEntry.id), + country = Logic.nilIfEmpty(squadEntry.nationality), + faction = Logic.nilIfEmpty((squadEntry.extradata or {}).faction), + name = Logic.nilIfEmpty(squadEntry.name), + } + + if DateExt.isDefaultTimestamp(squadEntry.leavedate) and DateExt.isDefaultTimestamp(squadEntry.inactivedate) then + infoboxArgs.team = squadEntry.pagename + end + + return infoboxArgs +end + +return EmptyPersonPagePreview From 522f1c269255da246bb2a3b11bd1f52ff79e0da0 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 15 Feb 2026 10:15:32 +0100 Subject: [PATCH 05/17] Update lua/wikis/commons/Widget/EmptyPagePreview/Person.lua Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index d7debdc910e..3429ef708df 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -93,7 +93,7 @@ end ---@return string? function EmptyPersonPagePreview:_getWiki() if Logic.isNotEmpty(self.props.wiki) then - return self.props.wiki + return self.props.wiki end if Logic.isNotEmpty(self.props.game) then return Game.toIdentifier{game = self.props.game} or self.props.game From 74e1ece877f9bbde68750a0a43e537e8de20c2d6 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 15 Feb 2026 10:15:58 +0100 Subject: [PATCH 06/17] Update lua/wikis/commons/Widget/EmptyPagePreview/Person.lua --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index 3429ef708df..28a4d3a7c3f 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -161,7 +161,7 @@ function EmptyPersonPagePreview:_results() return { HtmlWidgets.H3{children = 'Achievements'}, - tostring(Tabs.dynamic(tabArgs)) + Tabs.dynamic(tabArgs) } end From 63b9c540e5eaa6723bf102a87daa78cad89d1661 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 15 Feb 2026 10:17:31 +0100 Subject: [PATCH 07/17] Update lua/wikis/commons/Widget/EmptyPagePreview.lua Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> --- lua/wikis/commons/Widget/EmptyPagePreview.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview.lua b/lua/wikis/commons/Widget/EmptyPagePreview.lua index e7c7a24cd06..f9422575416 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview.lua @@ -7,13 +7,13 @@ local Lua = require('Module:Lua') -local Class = require('Module:Class') +local Class = Lua.import('Module:Class') local Namespace = Lua.import('Module:Namespace') local TeamTemplate = Lua.import('Module:TeamTemplate') local EmptyTeamPagePreview = Lua.import('Module:Widget/EmptyPagePreview/Team') local EmptyPersonPagePreview = Lua.import('Module:Widget/EmptyPagePreview/Person') -local Widget = require('Module:Widget') +local Widget = Lua.import('Module:Widget') ---@class EmptyPagePreview: Widget ---@operator call(table): EmptyPagePreview From 04da5c4e1017c73bffdf83f5e26e8d04e24a7f83 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sun, 15 Feb 2026 14:38:50 +0100 Subject: [PATCH 08/17] use `Opponent.playerFromLpdbStruct` and `Opponent.staffFromLpdbStruct` --- .../Widget/EmptyPagePreview/Person.lua | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index 28a4d3a7c3f..94d3b2e1528 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -11,12 +11,14 @@ local Array = Lua.import('Module:Array') local BroadcasterTable = Lua.import('Module:BroadcastTalentTable') local Class = Lua.import('Module:Class') local DateExt = Lua.import('Module:Date/Ext') +local FnUtil = Lua.import('Module:FnUtil') local Game = Lua.import('Module:Game') local Info = Lua.import('Module:Info', {loadData = true}) local Infobox = Lua.import('Module:Infobox/Person/Player/Custom') local Logic = Lua.import('Module:Logic') local MatchTable = Lua.import('Module:MatchTable/Custom') local Namespace = Lua.import('Module:Namespace') +local Opponent = Lua.import('Module:Opponent/Custom') local Page = Lua.import('Module:Page') local ResultsTable = Lua.import('Module:ResultsTable/Custom') local Table = Lua.import('Module:Table') @@ -201,33 +203,32 @@ function EmptyPersonPagePreview:_backfillInformationFromPlacements() end ---@param personData table - ---@return string? - local getPersonPrefix = function(personData) + ---@return standardPlayer? + local getPerson = function(personData) local index = 1 while personData['p' .. index] or personData['c' .. index] do if personData['p' .. index] == self.person then - return 'p' .. index + return Opponent.playerFromLpdbStruct(personData, index) end if personData['c' .. index] == self.person then - return 'c' .. index + return Opponent.staffFromLpdbStruct(personData, index) end index = index + 1 end end Array.forEach(Array.reverse(placements), function(placement) - -- can not use Opponent.fromLpdbStruct because it only converts players not coaches - local prefix = getPersonPrefix(placement.opponentplayers) - if not prefix then + local person = getPerson(placement.opponentplayers) + if not person then return end - local id = Logic.nilIfEmpty(placement.opponentplayers[prefix .. 'dn']) + local id = Logic.nilIfEmpty(person.displayName) table.insert(infoboxArgs.idsArray, id) Table.mergeInto(infoboxArgs, { id = id, - country = Logic.nilIfEmpty(placement.opponentplayers[prefix .. 'flag']), - faction = Logic.nilIfEmpty(placement.opponentplayers[prefix .. 'faction']), + country = person.flag, + faction = person.faction, }) end) From cef3674d3e59c959c9010ff2bbdaddb015c13b6a Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sun, 15 Feb 2026 14:41:26 +0100 Subject: [PATCH 09/17] unused import --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index 94d3b2e1528..9250f689e06 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -11,7 +11,6 @@ local Array = Lua.import('Module:Array') local BroadcasterTable = Lua.import('Module:BroadcastTalentTable') local Class = Lua.import('Module:Class') local DateExt = Lua.import('Module:Date/Ext') -local FnUtil = Lua.import('Module:FnUtil') local Game = Lua.import('Module:Game') local Info = Lua.import('Module:Info', {loadData = true}) local Infobox = Lua.import('Module:Infobox/Person/Player/Custom') From d7b6594c85fb7d824c7b1c99569c06a5994e7f62 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 15 Feb 2026 17:53:29 +0100 Subject: [PATCH 10/17] Update lua/wikis/commons/Widget/EmptyPagePreview/Person.lua Co-authored-by: SyntacticSalt --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index 9250f689e06..ca3df8f211e 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -86,7 +86,7 @@ function EmptyPersonPagePreview:_infobox() return id ~= infoboxArgs.id end) infoboxArgs.ids = table.concat(infoboxArgs.idsArray, ', ') - infoboxArgs.id = infoboxArgs.id or self.person:gsub('_', ' ') + infoboxArgs.id = infoboxArgs.id or self.props.pageName return Infobox.run(infoboxArgs) end From 0d1327d10016d5058cfd83251850f9a96d29f915 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 15 Feb 2026 17:55:05 +0100 Subject: [PATCH 11/17] Update lua/wikis/commons/Widget/EmptyPagePreview/Person.lua Co-authored-by: SyntacticSalt --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index ca3df8f211e..a9f5615fb22 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -140,8 +140,7 @@ function EmptyPersonPagePreview:_results() gameIcons = true, awards = true, achievements = true, - playerResultsOfTeam = false, - querytype = 'team', + querytype = 'solo', } if Logic.isNotEmpty(awardsAchievements) then tabArgs['name' .. index] = 'Awards Achievements' From 8c32fa1a6dcc57a82a52dab80c1ba66295adc276 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 15 Feb 2026 17:55:48 +0100 Subject: [PATCH 12/17] Update lua/wikis/commons/Widget/EmptyPagePreview/Person.lua Co-authored-by: SyntacticSalt --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index a9f5615fb22..31449d1624a 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -128,8 +128,7 @@ function EmptyPersonPagePreview:_results() gameIcons = true, awards = false, achievements = true, - playerResultsOfTeam = false, - querytype = 'team', + querytype = 'solo', }) } local index = 2 From 4af521103c8b17459499f29e344ad38ff3e4aaca Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sun, 15 Feb 2026 17:59:10 +0100 Subject: [PATCH 13/17] from review --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index 31449d1624a..eb985806414 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -149,8 +149,7 @@ function EmptyPersonPagePreview:_results() local talentAchievements = BroadcasterTable.run{ broadcaster = self.person, - achievements = 1, - aboutAchievementsLink = 'Template:Broadcast talent achievements table/doc', + achievements = true, useTickerNames = true, } if Logic.isNotEmpty(talentAchievements) then From 713badde01eec5eab4a6a226cf140ef9e9fd0c3e Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 17 Feb 2026 13:39:43 +0100 Subject: [PATCH 14/17] as per poll not needed anymore --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index eb985806414..bbe2edda4a9 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -73,7 +73,6 @@ function EmptyPersonPagePreview:_infobox() local infoboxArgs = Table.merge( { - wiki = self:_getWiki(), default = 'Infobox player NoImage.png', defaultDark = 'Infobox player NoImage darkmode.png', }, @@ -91,16 +90,6 @@ function EmptyPersonPagePreview:_infobox() return Infobox.run(infoboxArgs) end ----@return string? -function EmptyPersonPagePreview:_getWiki() - if Logic.isNotEmpty(self.props.wiki) then - return self.props.wiki - end - if Logic.isNotEmpty(self.props.game) then - return Game.toIdentifier{game = self.props.game} or self.props.game - end -end - ---@private ---@return (Widget|Html)[] function EmptyPersonPagePreview:_matches() From b14676786390038ba3f38e7049e0d891d1245c88 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 17 Feb 2026 13:40:40 +0100 Subject: [PATCH 15/17] unused import --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index bbe2edda4a9..f5db98c1911 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -11,7 +11,6 @@ local Array = Lua.import('Module:Array') local BroadcasterTable = Lua.import('Module:BroadcastTalentTable') local Class = Lua.import('Module:Class') local DateExt = Lua.import('Module:Date/Ext') -local Game = Lua.import('Module:Game') local Info = Lua.import('Module:Info', {loadData = true}) local Infobox = Lua.import('Module:Infobox/Person/Player/Custom') local Logic = Lua.import('Module:Logic') From 81ab856bae24493d140138fc441672df2cd17074 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Fri, 27 Mar 2026 07:36:28 +0100 Subject: [PATCH 16/17] as per preview --- lua/wikis/commons/Widget/EmptyPagePreview.lua | 2 +- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 2 +- lua/wikis/commons/Widget/EmptyPagePreview/Team.lua | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview.lua b/lua/wikis/commons/Widget/EmptyPagePreview.lua index f9422575416..697fdb99c71 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview.lua @@ -33,4 +33,4 @@ function EmptyPagePreview:render() return EmptyPersonPagePreview(self.props) end -return EmptyTeamPagePreview +return EmptyPagePreview diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index f5db98c1911..f1b8ac6ef7b 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -90,7 +90,7 @@ function EmptyPersonPagePreview:_infobox() end ---@private ----@return (Widget|Html)[] +---@return Widget[] function EmptyPersonPagePreview:_matches() return { HtmlWidgets.H3{children = 'Most Recent Matches'}, diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Team.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Team.lua index 8a4d2e1dac1..0735b5b76a2 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Team.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Team.lua @@ -246,7 +246,7 @@ function EmptyTeamPagePreview:_rosterFromTransfers() end ---@private ----@return (Widget|Html)[] +---@return Widget[] function EmptyTeamPagePreview:_matches() return { HtmlWidgets.H3{children = 'Most Recent Matches'}, @@ -260,7 +260,7 @@ function EmptyTeamPagePreview:_matches() end ---@private ----@return (Widget|Html)[] +---@return Widget[] function EmptyTeamPagePreview:_results() return { HtmlWidgets.H3{children = 'Achievements'}, From 2db6e464efc735d0372730cce7f7fbaabde78ef2 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Fri, 27 Mar 2026 07:49:08 +0100 Subject: [PATCH 17/17] kick tostring --- lua/wikis/commons/Widget/EmptyPagePreview/Person.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua index f1b8ac6ef7b..1fa237d8da4 100644 --- a/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua +++ b/lua/wikis/commons/Widget/EmptyPagePreview/Person.lua @@ -106,18 +106,18 @@ end ---@private ---@return (Widget|Html)[] function EmptyPersonPagePreview:_results() - ---@type table + ---@type table local tabArgs = { suppressHeader = true, name1 = 'Achievements', - content1 = tostring(ResultsTable.results{ + content1 = ResultsTable.results{ player = self.person, showType = true, gameIcons = true, awards = false, achievements = true, querytype = 'solo', - }) + } } local index = 2 @@ -131,7 +131,7 @@ function EmptyPersonPagePreview:_results() } if Logic.isNotEmpty(awardsAchievements) then tabArgs['name' .. index] = 'Awards Achievements' - tabArgs['content' .. index] = tostring(awardsAchievements) + tabArgs['content' .. index] = awardsAchievements index = index + 1 end @@ -142,7 +142,7 @@ function EmptyPersonPagePreview:_results() } if Logic.isNotEmpty(talentAchievements) then tabArgs['name' .. index] = 'Talent Achievements' - tabArgs['content' .. index] = tostring(talentAchievements) + tabArgs['content' .. index] = talentAchievements end return {