Content deleted Content added
No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 4:
function p.makeTableTop()
local headerRow = mw.html.create('tr')
:node(mw.html.create('th'):wikitext('Sitesite'))
:node(mw.html.create('th'):wikitext('IDid'))
:node(mw.html.create('th'):wikitext('Aliasalias'))
:node(mw.html.create('th'):wikitext('Notesnotes'))
:done()
 
Line 19:
function p.makeCell(cellType, args)
local function getColor(index)
return ((index or 0) % 2 == 0) and '#F3F3F3' or '#FFFFFF'
end
 
Line 29:
 
local function getAlias(alias, title)
if not alias or alias == '' then
return title'N/A'
else
return alias
end
end
end
 
local function getNotes(notes)
if not notes or notes == '' then
return 'N/A'
else
return notes
end
end
end
 
if not args.site then
return mw.html.create('tr')
:css('background-color', getColor(args.rowIndex))
:node(mw.html.create('td'):attr('colspan', '4'):wikitext('Invalid arguments. Please see documentation for correct usage.'))
:done()
Line 53:
local site = args.site or mw.title.getCurrentTitle().text
local id = args.id or ''
local alias = getAlias(args.alias, or ''site)
local notes = getNotes(args.notes or '')
local background = getBackground(site)
 
Line 72:
:css('background-color', background)
:css('padding', '8px')
:wikitext(getAlias(alias, mw.title.getCurrentTitle().text)aliasCell)
:done()
 
Line 78:
:css('background-color', background)
:css('padding', '8px')
:wikitext(getNotes(notes)notesCell)
:done()
 
return mw.html.create('tr')
:css('background-color', getColor(args.rowIndex))
:node(cell)
:node(idCell)
Line 114:
if site == '' then
return '<strong class="error">Error: </strong>Site parameter is required'
elseif not mw.loadData('Module:CareerList/config')[site:lower()] then
return '<strong class="error">Error: </strong>Invalid site specified'
else
return p.makeCell(site, id,= alias, notessite:lower()
elseif if not mw.loadData('Module:CareerList/config')[site:lower()] then
return '<strong class="error">Error: </strong>Invalid site specified'
else
return p.makeCell(site, id, alias, notes)
end
end
end