(Created page with "local getArgs = require('Module:Arguments').getArgs local Links = require('Module:Links') local Header = require('Module:Infobox/Widget/Header') local Subheader = require('Module:Infobox/Widget/Subheader') local LinksWidget = require('Module:Infobox/Widget/Links') local SponsorsWidget = require('Module:Infobox/Widget/Sponsors') local Flags = require('Module:Flags') local Infobox = {} function Infobox.main(frame) local args = getArgs(frame) local currentTitleSplit =...") |
No edit summary |
||
Line 4: | Line 4: | ||
local Subheader = require('Module:Infobox/Widget/Subheader') | local Subheader = require('Module:Infobox/Widget/Subheader') | ||
local LinksWidget = require('Module:Infobox/Widget/Links') | local LinksWidget = require('Module:Infobox/Widget/Links') | ||
local | local ListWidget = require('Module:Infobox/Widget/List') | ||
local LocationWidget = require('Module:Infobox/Widget/Location') | |||
local RowWidget = require('Module:Infobox/Widget/Row') | |||
local Flags = require('Module:Flags') | local Flags = require('Module:Flags') | ||
Line 19: | Line 21: | ||
:addClass('ib') | :addClass('ib') | ||
container:node(headerNode):node(Subheader.make( | container:node(headerNode):node(Subheader.make('Tournament Information')) | ||
if args. | if args.series then | ||
container:node(RowWidget.make('Series', args.series)) | |||
end | |||
if args.organizer then | |||
container:node(RowWidget.make('Organizer', ListWidget.make(args.organizer))) | |||
end | |||
if args.sponsors then | |||
container:node(RowWidget.make('Sponsors', ListWidget.make(args.sponsors))) | |||
end | |||
if args.type then | |||
container:node(RowWidget.make('Type', args.type)) | |||
container:node( | |||
end | end | ||
if args. | if args.country then | ||
container:node(RowWidget.make('Location', LocationWidget.make(args.country, args.city))) | |||
end | end | ||
if args.venue then | |||
container:node(RowWidget.make('Venue', ListWidget.make(args.venue))) | |||
end | |||
if args.format then | |||
container:node(RowWidget.make('Format', ListWidget.make(args.format))) | |||
end | |||
if args. | if args.prize then | ||
container:node(RowWidget.make('Prize pool', args.prize)) | |||
end | end | ||
if args. | if args.start then | ||
container:node(RowWidget.make('Start date', args.start)) | |||
end | end | ||
if args | if args['end'] then | ||
container:node(RowWidget.make('End date', args['end'])) | |||
end | end | ||
if args. | if args.version or args.patch then | ||
container:node(RowWidget.make('Patch', args.version or args.patch, frame)) | |||
end | end | ||
if args. | if args.teams then | ||
container:node(RowWidget.make('Teams', args.teams)) | |||
end | end | ||
if args. | if args.points then | ||
container:node(RowWidget.make('Pro Circuit Points', args.points)) | |||
end | end | ||
Revision as of 17:41, 30 August 2022
Documentation for this module may be created at Module:Infobox tournament/doc
local getArgs = require('Module:Arguments').getArgs
local Links = require('Module:Links')
local Header = require('Module:Infobox/Widget/Header')
local Subheader = require('Module:Infobox/Widget/Subheader')
local LinksWidget = require('Module:Infobox/Widget/Links')
local ListWidget = require('Module:Infobox/Widget/List')
local LocationWidget = require('Module:Infobox/Widget/Location')
local RowWidget = require('Module:Infobox/Widget/Row')
local Flags = require('Module:Flags')
local Infobox = {}
function Infobox.main(frame)
local args = getArgs(frame)
local currentTitleSplit = mw.text.split(mw.title.getCurrentTitle().text, '/')
local headerNode = Header.make(args.title or currentTitleSplit[2], args.image or '')
local container = mw.html.create('div')
:addClass('ib')
container:node(headerNode):node(Subheader.make('Tournament Information'))
if args.series then
container:node(RowWidget.make('Series', args.series))
end
if args.organizer then
container:node(RowWidget.make('Organizer', ListWidget.make(args.organizer)))
end
if args.sponsors then
container:node(RowWidget.make('Sponsors', ListWidget.make(args.sponsors)))
end
if args.type then
container:node(RowWidget.make('Type', args.type))
end
if args.country then
container:node(RowWidget.make('Location', LocationWidget.make(args.country, args.city)))
end
if args.venue then
container:node(RowWidget.make('Venue', ListWidget.make(args.venue)))
end
if args.format then
container:node(RowWidget.make('Format', ListWidget.make(args.format)))
end
if args.prize then
container:node(RowWidget.make('Prize pool', args.prize))
end
if args.start then
container:node(RowWidget.make('Start date', args.start))
end
if args['end'] then
container:node(RowWidget.make('End date', args['end']))
end
if args.version or args.patch then
container:node(RowWidget.make('Patch', args.version or args.patch, frame))
end
if args.teams then
container:node(RowWidget.make('Teams', args.teams))
end
if args.points then
container:node(RowWidget.make('Pro Circuit Points', args.points))
end
container:node(Subheader.make('Links'))
local transformedLinks = Links.transform(args)
local fullLinks = LinksWidget.make(transformedLinks, 'team')
container:node(fullLinks)
return container
end
return Infobox