« Module:Infobox/Défi » : différence entre les versions
Page créée avec « local localdata = require('Module:Infobox/Localdata') function buildSuccess(localdata) local success = nil local icon = require('Module:Icône') if localdata['achèv… » |
(Aucune différence)
|
Version du 17 juin 2021 à 15:42
Ce module contient le paramétrage de l'infobox {{Infobox défi}}.
local localdata = require('Module:Infobox/Localdata')
function buildSuccess(localdata)
local success = nil
local icon = require('Module:Icône')
if localdata['achèvement'] then
success = localdata['achèvement']
end
if localdata['gamerscore'] or localdata['type trophée'] then
if success == nil then
success = mw.title.getCurrentTitle().text
end
success = success ..'<div style="float:right;padding-left:15px;position:relative;white-space:nowrap;">'
if localdata['gamerscore'] then
success = success ..'<span style="padding-left:4px;">'.. icon.build({ 'gamerscore' }) ..'</span>'
success = success ..'<span style="padding-left: 2px;position:relative;top:1px;">'.. localdata['gamerscore'] ..'</span>'
end
if localdata['type trophée'] then
success = success ..'<span style="padding-left:4px;">'.. icon.build({ 'trophéeps3' }) ..'</span>'
success = success ..'<span style="padding-left: 2px;position:relative;top:1px;">'.. localdata['type trophée'] ..'</span>'
end
success = success..'</div>'
end
return success
end
return {
parts = {
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = 'Défi', link = 'Défis' }},
{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
{ type = 'table', separator = true, rows = {
{ type = 'row', label = 'Tâche', value = 'tâche' },
{ type = 'row', label = 'Requiert', value = 'requiert' },
{ type = 'row', label = 'Récompense', value = 'Récompense' },
{ type = 'row', label = 'Succès', value = function (localdata) return buildSuccess(localdata) end },
{ type = 'row', label = 'Répétition', value = 'répétition' },
{ type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid' }
}},
{ type = 'text', value = 'pied' }
}
}