Jump to content

📢 Please make sure to read our Style Guide before editing. For questions, suggestions, or technical issues, please contact Noah.

Module:Infobox Season: Difference between revisions

From CrabCraft Wiki
Undo revision 302 by Max (talk)
Tag: Undo
Only format if not embed
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


local infobox = require("Module:Infobox")
local infobox = require("Module:Infobox")
local section_colour = '#097969'


function p.infobox(frame)
function p.infobox(frame)
Line 10: Line 8:
local season_args = {
local season_args = {
    {'t', args.name},
    {'t', args.name},
    {'i', args.image},
        {'i', args.image and args.image ~= '' and string.format('[[File:%s|300px]]', args.image) or ''},
    {'s', 'Overview'},
        {'s', 'Overview'},
    {'f', 'Name', args.name},
    {'f', 'Name', args.name},
    {'f', 'Started', args.started},
    {'f', 'Started', args.started},
Line 26: Line 24:
    {'f', 'Download Link', args.worlddownload},
    {'f', 'Download Link', args.worlddownload},
}
}
local box_args = {section_colour, season_args}


     return infobox.infobox {
     return infobox.infobox {
         getParent = function() return { args = box_args } end
         getParent = function() return { args = season_args } end
     }
     }
end
end


return p
return p

Latest revision as of 10:59, 24 June 2025

Documentation for this module may be created at Module:Infobox Season/doc

local p = {}

local infobox = require("Module:Infobox")

function p.infobox(frame)
    local args = frame:getParent().args

	local season_args = {
	    {'t', args.name},
        {'i', args.image and args.image ~= '' and string.format('[[File:%s|300px]]', args.image) or ''},
        {'s', 'Overview'},
	    {'f', 'Name', args.name},
	    {'f', 'Started', args.started},
	    {'f', 'Ended', args.ended},
	    {'f', 'Total Days', args.totaldays},
	    {'s', 'Player Statistics'},
	    {'f', 'Whitelisted Players', args.players},
	    {'f', 'Peak Players', args.peakplayers},
	    {'s', 'Server Info'},
	    {'f', 'Version', args.version},
	    {'f', 'Platform', args.platform},
	    {'f', 'Experiments', args.experiments},
	    {'s', 'World Download'},
	    {'f', 'Download Link', args.worlddownload},
	}

    return infobox.infobox {
        getParent = function() return { args = season_args } end
    }
end

return p