Module:ParticipantsQuery

local util_args = require('Module:ArgsUtil') local util_cargo = require("Module:CargoUtil") local util_esports = require("Module:EsportsUtil") local util_html = require("Module:HtmlUtil") local util_map = require('Module:MapUtil') local util_table = require("Module:TableUtil") local util_text = require("Module:TextUtil") local util_vars = require("Module:VarsUtil") local i18n = require("Module:I18nUtil") local TeamRoster = require('Module:TeamRoster')._main local lang = mw.getLanguage('en') local h = {} local p = {} function p.main(frame) local args = util_args.merge local page = args.page or util_esports.getOverviewPage local teams = h.getTeamsData(page) local nodes = util_map.inPlace(teams, TeamRoster) return h.makeOutput(nodes) end

function h.getTeamsData(page) local result = h.makeAndRunQuery(page) return util_map.inPlace(result, util_cargo.extractArgs) end

function h.makeAndRunQuery(page) local query = { tables = 'ParticipantsArgs', orderBy = 'N_TeamInPage', where = { ('OverviewPage="%s"'):format(page) }, fields = 'Args', }	return util_cargo.getOrderedList(query, 'Args') end

function h.makeOutput(nodes) local frame = mw.getCurrentFrame return frame:preprocess(''), util_table.concat(nodes, frame:preprocess(''), tostring), frame:preprocess('') end

return p