Module:Maintenance

local p = {}

function p.main(frame) -- No args needed return p.getMaintenanceTable end

function p.getMaintenanceTable -- Create the table element local result = mw.html.create('table') result :addClass('wikitable') :addClass('sitecolor-generic') :addClass('mw-collapsible') :css('text-align', 'center')

-- Add header row result:tag('tr') :tag('th') :attr('colspan', '10') :wikitext('Maintenance')

-- Add the category names row local categoriesRow = result:tag('tr') local categories = { 'Pending moves or splits', 'Articles under construction', 'Stubs', 'Pages with translation needed', 'Files needing improvement', 'Articles needing images', 'Policy proposals', 'Active demotion requests', 'Active rights requests', 'Pending deletions' }   for _, category in ipairs(categories) do        categoriesRow:tag('th'):wikitext(category) end

-- Add the counts row local countsRow = result:tag('tr') local countCategories = { 'Pages pending move', 'Articles under construction', 'Stubs', 'Pages with translation needed', 'Files needing reupload', 'Articles needing images', 'Policy proposals', 'Active demotion requests', 'Active rights requests', 'Pages pending deletion' }   for _, countCategory in ipairs(countCategories) do    	local count = mw.site.stats.pagesInCategory(countCategory, 'all') countsRow:tag('td'):wikitext(count) end

return tostring(result) end

return p