Module:Banned

local p = {}

local banned = require("Module:Banned/data")

function p.list local items = {} local ret = mw.html.create('table') ret :addClass('wikitable sortable') :tag('tr') :tag('th'):wikitext('Username'):done :tag('th'):wikitext('Reason'):done :tag('th'):wikitext('Permanent'):done :done

for index, data in ipairs(banned) do   ret:node( generateRow(data.username, data.reason, data.link, data.temporary) ) end return ret end

function generateRow(username, reason, link, temporary) local ret = mw.html.create('tr') if link == nil then ret:tag('td'):wikitext ( username ):done else ret:tag('td'):wikitext ( "" .. username .. "" ):done end if string.find(reason, "Unknown") then ret :tag('td'):wikitext( reason ) :css({           background = 'rgba(127,127,127,0.3)';            color = 'rgba(127,127,127,0.9)';            cursor = 'default';            ['user-select'] = 'none';          }) :done else ret:tag('td'):wikitext( reason ):done end if temporary == true then ret :tag('td'):wikitext( "" ) :css({           ['text-align'] = 'center';          }) :done else ret :tag('td'):wikitext( "" ) :css({           ['text-align'] = 'center';          }) :done end return ret end

function p.amount local amount = 8 -- we start at 8 to adjust for users who have alts with the same name for index, data in ipairs(banned) do 	amount = amount + 1 end return amount end

return p