15 131
modifications
Page créée avec « local localdata = require('Module:Infobox/Localdata') function buildReleaseDateRow(localdata, index) local row = { type = 'text'} if localdata['plateforme'..index] and… » |
Aucun résumé des modifications |
||
(5 versions intermédiaires par 3 utilisateurs non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
local localdata = require('Module:Infobox/Localdata') | local localdata = require('Module:Infobox/Localdata') | ||
-- Sujet | |||
function buildSubject(localdata) | |||
local subject | |||
local addonType = localdata['type'] | |||
if addonType then | |||
local types = { | |||
['dlc'] = 'Contenu téléchargeable', | |||
['maj'] = 'Mise à jour majeure' | |||
} | |||
subject = types[addonType:lower()] or 'Contenu téléchargeable' | |||
else | |||
subject = 'Contenu téléchargeable' | |||
end | |||
return subject | |||
end | |||
-- Lien | |||
function buildLink(localdata) | |||
local link | |||
local addonType = localdata['type'] | |||
if addonType then | |||
local types = { | |||
['dlc'] = 'Contenus téléchargeables', | |||
['maj'] = 'Mises à jour majeures' | |||
} | |||
link = types[addonType:lower()] or 'Contenu téléchargeable' | |||
else | |||
link = 'Contenus téléchargeables' | |||
end | |||
return link | |||
end | |||
-- Table des dates de sortie | |||
function buildReleaseDateRow(localdata, index) | function buildReleaseDateRow(localdata, index) | ||
local row = { type = 'text'} | local row = { type = 'text'} | ||
if localdata['plateforme'..index] and localdata['plateforme'..index..'date'] then | if localdata['plateforme'..index] and localdata['plateforme'..index..'date'] then | ||
row = { type = 'row', label = localdata['plateforme'..index], value = localdata['plateforme'..index..'date'] } | row = { type = 'row', label = localdata['plateforme'..index], value = function(localdata) return localdata['plateforme'..index..'date'] end } | ||
end | end | ||
return row | return row | ||
end | end | ||
-- Table des disponibilités | |||
function buildPlatformLinkRow(localdata, index) | function buildPlatformLinkRow(localdata, index) | ||
local row = { type = 'text'} | local row = { type = 'text'} | ||
if localdata['plateforme'..index] and localdata['plateforme'..index..'dispo'] then | if localdata['plateforme'..index] and localdata['plateforme'..index..'dispo'] then | ||
row = { type = 'row', label = localdata['plateforme'..index], value = localdata['plateforme'..index..'dispo'] } | row = { type = 'row', label = localdata['plateforme'..index], value = function(localdata) return localdata['plateforme'..index..'dispo'] end } | ||
end | end | ||
return row | return row | ||
Ligne 19 : | Ligne 57 : | ||
return { | return { | ||
parts = { | parts = { | ||
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = | { type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = buildSubject(localdata), link = buildLink(localdata) }}, | ||
{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }}, | { type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }}, | ||
{ type = 'table', title = 'Général', rows = { | { type = 'table', title = 'Général', rows = { | ||
{ type = 'row', label = 'Développeurs', value = 'développeurs' }, | { type = 'row', label = 'Développeurs', value = 'développeurs' }, | ||
{ type = 'row', label = 'Éditeur', value = 'éditeur' } | { type = 'row', label = 'Éditeur', value = 'éditeur' }, | ||
{ type = 'row', label = 'Saison', value = 'saison' } | |||
}}, | }}, | ||
{ type = 'table', title = 'Dates de sortie', rows = { | { type = 'table', title = 'Dates de sortie', rows = { | ||
{ type = "row", label = "Date de sortie", value = { "date de sortie", "date" }}, | |||
buildReleaseDateRow(localdata, '1'), | buildReleaseDateRow(localdata, '1'), | ||
buildReleaseDateRow(localdata, '2'), | buildReleaseDateRow(localdata, '2'), | ||
Ligne 42 : | Ligne 82 : | ||
{ type = 'row', label = 'Taille', value = 'taille' }, | { type = 'row', label = 'Taille', value = 'taille' }, | ||
{ type = 'row', label = 'Patch', value = 'patch' } | { type = 'row', label = 'Patch', value = 'patch' } | ||
}}, | |||
{ type = 'table', rows = { | |||
{ type = 'succession', value = { | |||
before = function(localdata) return localdata['précédent'] end, | |||
after = function(localdata) return localdata['suivant'] end | |||
}}, | |||
{ type = 'row1col', value = { 'partie de' } } | |||
}}, | }}, | ||
{ type = 'text', value = 'pied' } | { type = 'text', value = 'pied' } | ||
} | } | ||
} | } |
modifications