(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 Flags = require('Module:Flags') local Infobox = {} function Infobox.main(frame) local args = getArgs(frame) local currentTitleSplit = mw.text.split(mw.title.getCurrentTitle().text, '/') local head...") |
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 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 18: | Line 21: | ||
:addClass('ib') | :addClass('ib') | ||
container:node(headerNode):node(Subheader.make( | container:node(headerNode):node(Subheader.make('Tournament Information')) | ||
if args. | if args.headquarter then | ||
container:node(RowWidget.make('Headquarter', LocationWidget.make(args.headquarter, args.city))) | |||
end | |||
if args.founded then | |||
container:node(RowWidget.make('Founded', args.founded)) | |||
end | end | ||
if args. | if args.employees then | ||
container:node(RowWidget.make('Employees', args.employees)) | |||
end | end | ||
if args. | if args.sponsors then | ||
container:node(RowWidget.make('Sponsors', ListWidget.make(args.sponsors))) | |||
end | end | ||
if args. | if args.type then | ||
container:node(RowWidget.make('Type', args.type)) | |||
end | end | ||
if args. | if args.parent then | ||
container:node(RowWidget.make('Parent', args.parent)) | |||
end | end | ||
if args. | if args.subsidiaries then | ||
container:node(RowWidget.make('Sponsors', ListWidget.make(args.subsidiaries))) | |||
end | end | ||
Line 135: | Line 58: | ||
container:node(fullLinks) | container:node(fullLinks) | ||
return container | return container | ||
end | end | ||
return Infobox | return Infobox |
Revision as of 19:51, 31 August 2022
Documentation for this module may be created at Module:Infobox company/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.headquarter then
container:node(RowWidget.make('Headquarter', LocationWidget.make(args.headquarter, args.city)))
end
if args.founded then
container:node(RowWidget.make('Founded', args.founded))
end
if args.employees then
container:node(RowWidget.make('Employees', args.employees))
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.parent then
container:node(RowWidget.make('Parent', args.parent))
end
if args.subsidiaries then
container:node(RowWidget.make('Sponsors', ListWidget.make(args.subsidiaries)))
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