PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Module:Event: Difference between revisions

From PC Gaming Shelter
Created page with "local utils = require( 'Module:Utils' ) local p = {} local function propertiesPlan() -- ['Form field name'] = { 'Semantic property', 'delimiter' } local propMap = { ['Image'] = {'Image', 'file' }, ['Related game'] = {'Related game' }, ['Has genre'] = {'Has genre' }, ['Has short description'] = {'Has short description' }, ['Has start date'] = {'Has start date' }, ['Has end date'] = {'Has end date' }, [..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
local propMap = {
local propMap = {
['Image']                = {'Image', 'file' },
['Image']                = {'Image', 'file' },
['Related game']          = {'Related game' },
['Related game']          = {'Related game', ',' },
['Has genre']            = {'Has genre' },
['Has genre']            = {'Has genre', ',' },
['Has short description'] = {'Has short description' },
['Has short description'] = {'Has short description' },
['Has start date']        = {'Has start date' },
['Has start date']        = {'Has start date' },
Line 41: Line 41:
},
},
['Event Links'] = {
['Event Links'] = {
heading = 'Links',
heading = 'Discover & Join',
template = 'Infobox/Event links',
template = 'Infobox/Event links',
order = '3',
order = '3',
Line 53: Line 53:


function p.infobox(frame)
function p.infobox(frame)
local category  = 'Mods'
local category  = 'Events'
local properties = propertiesPlan()
local properties = propertiesPlan()
local sections  = infoboxSectionPlan()
local sections  = infoboxSectionPlan()

Latest revision as of 22:41, 25 March 2026

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

local utils = require( 'Module:Utils' )

local p = {}

local function propertiesPlan()
	-- ['Form field name'] = { 'Semantic property', 'delimiter' }
	local propMap = {
		['Image']                 = {'Image', 'file' },
		['Related game']          = {'Related game', ',' },
		['Has genre']             = {'Has genre', ',' },
		['Has short description'] = {'Has short description' },
		['Has start date']        = {'Has start date' },
		['Has end date']          = {'Has end date' },
		['Has tag']               = {'Has tag', ',' }
	}
	return propMap
end

local function infoboxSectionPlan()
	local sectionMap = {
		['Cover image'] = {
			heading = '',
			template = 'Infobox/Cover',
			order = '1',
			rows = {
				'Image'
			}
		},
		['Event Info'] = {
			heading = 'Event Info',
			template = 'Infobox/Event Info',
			order = '2',
			rows = {
				'Related game',
				'Has genre',
				'Has short description',
				'Has start date',
				'Has end date',
				'Has tag'
			}
		},
		['Event Links'] = {
			heading = 'Discover & Join',
			template = 'Infobox/Event links',
			order = '3',
			rows = {
				'Event links'
			}
		}
	}
	return sectionMap
end

function p.infobox(frame)
	local category   = 'Events'
	local properties = propertiesPlan()
	local sections   = infoboxSectionPlan()
	local footer     = ''
	local infobox    = utils.createInfobox(frame, category, properties, sections, footer)
	return infobox
end

return p