1,124
edits
Line 9: | Line 9: | ||
local rank = com.fUpper(args[1]) | local rank = com.fUpper(args[1]) | ||
local jobs = {} | local jobs = {} | ||
for k, v in pairs(b) do | for k, v in pairs(b) do | ||
if v.rank == rank then | if v.rank == rank then | ||
Line 17: | Line 18: | ||
table.sort(jobs) | table.sort(jobs) | ||
mw.log(#jobs) | mw.log(#jobs) | ||
local cols = { | |||
'column-count', (args[2] or 3) | |||
} | |||
local jobList = mw.html.create('div') | |||
jobList:addClass('job-list') | |||
:css(cols) | |||
:tag('ul') | |||
for k, v in pairs(jobs) do | |||
local jobName = mw.html.create('li') | |||
jobName:wikitext('[[' .. k .. ']]') | |||
jobList:node(jobName) | |||
end | |||
return jobList | |||
end | end | ||
return '' | return '' | ||
end | end | ||
return p | return p |