Module:Infobox/Jeu vidéo
Wikimedia module / De Wikipedia, l'encyclopédie encyclopedia
local jeu = require "Module:Infobox/Fonctions" local wd = require("Module:Wikidata") local localdata = require("Module:Infobox/Localdata")
-- Fonction permettant d'afficher une boîte déroulante local function navframe() -- affiche la boîte déroulante local function navbox() if localdata["date détail"] then
return '
"
end end
return { type = "row", value = navbox } end local detail = navframe()
-- Fonction permettant l'affichage de la partie succession local function buildsuccession() localdata["précédent"] = localdata["précédent"] or wd.formatStatements {property = "P179", showonlyqualifier = "P155"} localdata["suivant"] = localdata["suivant"] or wd.formatStatements {property = "P179", showonlyqualifier = "P156"} localdata["franchise"] = localdata["franchise"] or wd.formatStatements {property = "P179"} -- Fonction permettant de définir le titre de la partie succession local function titre(a, b, c) if c and (a or b) then return "" .. c .. "" end end
-- Fonction permettant l'affichage des articles de la partie succession local function succession(a, b, c, d) succession = {} if (a and b) then succession["before"] = "" .. a .. " (" .. b .. ")" elseif a then succession["before"] = "" .. a .. "" end if (c and d) then succession["after"] = "" .. c .. " (" .. d .. ")" elseif c then succession["after"] = "" .. c .. "" end return succession end
if localdata["précédent"] or localdata["suivant"] then return { type = "table", separator = true, rows = { {type = "row1col", value = titre(localdata["précédent"], localdata["suivant"], localdata["franchise"])} } }, { type = "table", separator = true, rows = { { type = "succession", color = transparent, value = succession( localdata["précédent"], localdata["date précédent"], localdata["suivant"], localdata["date suivant"] ) } } } end end
return { maincolor = "#004080", parts = { { type = "title", value = "titre", icon = "jeuvideo", style = {["color"] = "white"}, italic = function(localdata) return not localdata["titre en italique"] end, setdisplaytitle = function(localdata) return not localdata["titre en italique"] end }, { type = "images", imageparameters = {"image", "logo"}, captionparameter = "légende", sizeparameter = {"taille", "taille image", "taille logo"}, altparameter = "alternative" }, { type = "images", imageparameters = {"image2"}, captionparameter = "légende2", sizeparameter = {"taille2", "taille image2"}, altparameter = "alternative2" }, { type = "table", separator = true, rows = { { type = "row", label = "Développeur", value = "développeur", property = "P178" }, { type = "row", label = "Éditeur", value = "éditeur", property = "P123" }, { type = "row", label = "Distributeur", value = "distributeur" }, { type = "row", label = "Réalisateur", value = {"directeur", "concepteur", "réalisateur"}, property = "P57" }, { type = "row", label = "Scénariste", value = "scénariste", property = "P58" }, { type = "row", label = "Compositeur", value = {"compositeur", "musique"}, property = "P86" }, { type = "row", label = "Producteur", value = "producteur", property = "P162" } } }, { type = "table", separator = true, rows = { { type = "row", label = "Début du projet", value = "début du projet", property = "P571" }, { type = "row", label = "Accès anticipé", value = "accès anticipé" }, { type = "row", label = "Date de sortie", value = "date" } } }, { type = "table", rows = { detail } }, { type = "table", rows = { { type = "row", label = "Date de fin", value = "date de fin", property = "P2669" }, { type = "row", label = "Franchise", value = function(localdata) if (localdata["franchise"] and (localdata["précédent"] or localdata["suivant"])) then return elseif localdata["franchise"] then return "" .. localdata["franchise"] .. "" end end }, { type = "row", label = "Genre", value = "genre", property = "P136" }, { type = "row", label = "Mode de jeu", value = "mode", property = "P404" }, { type = "row", label = "Plateforme", value = {"plateforme", "plate-forme"}, property = "P400" } } }, { type = "table", separator = true, rows = { { type = "row", label = "Langue", value = "langue", property = "P407" }, { type = "row", label = "Moteur", value = {"moteur de jeu", "moteur"}, property = "P408" }, { type = "row", label = "Version", value = "version", wikidata = { property = 'P348', rank = valid, showqualifiers = {'P577'} } } } }, { type = "table", separator = true, rows = { { type = "row", label = "Ventes", value = "ventes",
}, { type = "row", label = "Évaluation", value = "évaluation", property = "P908" }, { type = "row", label = "Site web", value = "site web", property = "P856" } } }, buildsuccession() } }