Module:Infobox/Fiction

De Les Archives de Vault-Tec
Documentation du module

Ce module contient le paramétrage de l'infobox {{Infobox fiction}}.

Documentation transclues de Module:Infobox/Fiction/doc.
local localdata = require( 'Module:Infobox/Localdata' )

--------------------------------------------------------
-----         Calcul des champs à afficher         -----
--------------------------------------------------------

-- Apparitions
local apparition = localdata['apparition']
if apparition then
	apparition = require( 'Module:Abréviation' ).links({ apparition, ['séparateur'] = '<br/>' })
end

-- sujet
local subject = localdata['type']
if subject then
	local types = {
		['personnage'] = 'Personnage fictif',
	}
	subject = types[subject:lower()] or 'Fiction'
else
	subject = 'Fiction'
end

--------------------------------------------------------
-----          Construction de l'infobox           -----
--------------------------------------------------------

return {
	parts = {
		{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { subject = subject }},
		{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
		{ type = 'table', separator = true, rows = {
			{ type = 'row', label = 'Rôle', value = 'rôle' },
			{ type = 'row', label = 'Affiliation', value = 'affiliation' },
		}},
		{ type = 'table', separator = true, rows = {
			{ type = 'row', label = 'Média', value = 'média' },
			{ type = 'row', label = 'Créateur', value = 'créateur' },
			{ type = 'row', label = 'Propriétaire', value = 'propriétaire' },
			{ type = 'row', label = 'Apparitions', value = function() return apparition end }
		}},
		{ type = 'text', value = 'pied' }
	}
}