Modification de Module:Bandeau de rubrique
La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.
Version actuelle | Votre texte | ||
Ligne 2 : | Ligne 2 : | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
----- | ----- Référentiel des bandeaux de rubrique ----- | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
data = { | data = { | ||
["principal"] = { | |||
warning = false, | |||
text = function(args) | |||
local link = args[1] | local link = args[1] | ||
local display = args['t1'] or link | |||
if not link then return end | |||
if | |||
text = '[[' .. link .. '|' .. display .. ']]' | |||
text = | |||
local many = false | |||
for i = 2, 5 do | for i = 2, 5 do | ||
link = args[i] | local link = args[i] | ||
local display = args['t' .. i] or link | |||
if link then | if link then | ||
many = true | |||
text = text .. | text = text .. ', [[' .. link .. '|' .. display .. ']]' | ||
else | else | ||
break | break | ||
Ligne 32 : | Ligne 28 : | ||
end | end | ||
if many then | |||
text = 'Articles principaux : ' .. text | |||
if | |||
else | else | ||
text = 'Article principal : ' .. text | |||
end | end | ||
return 'Extrait de l\'article [[' .. article .. ']]' | return text | ||
.. | end | ||
}, | |||
["extrait"] = { | |||
warning = false, | |||
text = function(args) | |||
local article = args[1] | |||
local title = mw.title.new(article) | |||
local section = args[2] | |||
return 'Extrait de l\'article [[' .. article .. ']], section ' | |||
.. section .. '. ([' .. title:fullUrl('action=edit') .. ' modifier])' | |||
.. ' · ([[Aide:Inclusion|Qu\'est ce que c\'est ?]])' | .. ' · ([[Aide:Inclusion|Qu\'est ce que c\'est ?]])' | ||
end | |||
} | |||
} | } | ||
Ligne 172 : | Ligne 69 : | ||
local banner = data[args.nom:lower()] | local banner = data[args.nom:lower()] | ||
local image = banner.image | local image = banner.image or '' | ||
local text = banner.text | local text = banner.text | ||
local category = banner.category | local category = banner.category or '' | ||
if category | if category ~= '' then | ||
if game ~= '' then | if game ~= '' then | ||
game = require( 'Module:Abréviation' ).name(game) or '' | game = require( 'Module:Abréviation' ).name(game) or '' | ||
Ligne 185 : | Ligne 81 : | ||
end | end | ||
category = '[[Catégorie:' .. category .. game .. ']]' | category = '[[Catégorie:' .. category .. game .. ']]' | ||
end | end | ||
if image then | if image ~= '' then | ||
image = mw.html.create( ' | image = mw.html.create( 'span' ) | ||
:addClass( 'avt-section-banner-img' ) | |||
:wikitext( '[[Fichier:' .. image .. '|x30px|link=|alt=]]' ) | :wikitext( '[[Fichier:' .. image .. '|x30px|link=|alt=]]' ) | ||
:done() | :done() | ||
Ligne 201 : | Ligne 96 : | ||
local res = mw.html.create( 'div' ) | local res = mw.html.create( 'div' ) | ||
:addClass( 'avt-section-banner noexcerpt' ) | :addClass( 'avt-section-banner noexcerpt' ) | ||
: | :wikitext(tostring(image) .. text) | ||
:done() | :done() | ||