Module:FeaturedLeaguesForm

local util_args = require('Module:ArgsUtil') local util_html = require('Module:HtmlUtil') local util_table = require('Module:TableUtil') local util_vars = require('Module:VarsUtil') local Tabs = require('Module:TabsDynamic')._main local i18n = require('Module:i18nUtil') local SETTINGS = require('Module:FeaturedLeagues/Settings')

local COLUMNS = { 'Index', 'Tournament', 'Active' }

local h = {} local p = {} function p.main(frame) i18n.init('FeaturedLeaguesForm') local tbl = {} for i = 1, SETTINGS.maxregions do		local round = { Tabs({'tab'}), tostring(h.intro(i)), tostring(h.fields(i)) }		tbl[#tbl+1] = util_table.concat(round, '\n') end return util_table.concat(tbl, '\n') end

function h.intro(i) local output = mw.html.create local tbl = output:tag('table') local tr = tbl:tag('tr') tr:tag('th'):wikitext('Region Abbreviation') :tag('th'):wikitext('Active') tr = tbl:tag('tr') tr:tag('td'):wikitext((''):format(i)) tr:tag('td'):wikitext((''):format(i)) return output end

function h.fields(i) local tbl = mw.html.create('table') util_html.printHeaderFromI18n(tbl, COLUMNS) for j = 1, SETTINGS.maxtournaments do		local tr = tbl:tag('tr') tr:tag('td'):wikitext(j) tr:tag('td'):wikitext((''):format(i, j)) tr:tag('td'):wikitext((''):format(i, j)) end return tbl end

return p