Module:GroupInfobox

local roblox_urls = require('Module:RobloxUrls') local links = require('Module:Links') local utils = require("Module:Utils") local infobox_utils = require('Module:InfoboxUtils')

local categorize = utils.categorize(0)

local p = {}

function p._format_title(args) if args.id == '' then return infobox_utils.error_message(" parameter missing") elseif tonumber(args.id) then return links.plain_external_link(roblox_urls.group(args.id), args.name) else return infobox_utils.error_message(" must be an integer.") end end

p.format_title = utils.make_wrapper_function(p._format_title)

function p._format_owner(args) return infobox_utils.player_link(args.owner) end

p.format_owner = utils.make_wrapper_function(p._format_owner)

function p._format_activity(args) local activity = args.activity:lower if activity == 'active' then return "Active" .. categorize("Active groups") elseif activity == 'inactive' or activity == 'not active' then return "Inactive" .. categorize("Inactive groups") elseif activity == 'abandoned' or activity == 'dead' then return "Abandoned" .. categorize("Abandoned groups") else return infobox_utils.error_message(" must be 'active', 'inactive' or 'abandoned'") end end

p.format_activity = utils.make_wrapper_function(p._format_activity)

function p._format_members(args) return infobox_utils.format_number(args.members, 1000, "Groups with less than 15000 members", 15000) end

p.format_members = utils.make_wrapper_function(p._format_members)

return p