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 = { | ||
["extrait"] = { | ["extrait"] = { | ||
warning = false, | |||
text = function(args) | |||
local article = args[1] | |||
local title = mw.title.new(article) | |||
local inclusionType = '' | |||
local section = args['section'] | |||
local heading = args['rubrique'] | |||
if section then | |||
inclusionType = ' · Section ' .. section | |||
elseif heading then | |||
inclusionType = ' · Rubrique ' .. heading | |||
else | |||
inclusionType = ' · Introduction' | |||
end | |||
return 'Extrait de l\'article [[' .. article .. ']]' | return 'Extrait de l\'article [[' .. article .. ']]' | ||
.. inclusionType | .. inclusionType | ||
.. ' · ([' .. title:fullUrl('action=edit') .. ' modifier])' | .. ' · ([' .. title:fullUrl('action=edit') .. ' modifier])' | ||
.. ' · ([[Aide:Inclusion|Qu\'est ce que c\'est ?]])' | .. ' · ([[Aide:Inclusion|Qu\'est ce que c\'est ?]])' | ||
end | |||
}, | |||
["principal"] = { | |||
warning = false, | |||
text = function(args) | |||
local link = args[1] | local link = args[1] | ||
local display = args['t1'] or link | local display = args['t1'] or link | ||
Ligne 137 : | Ligne 59 : | ||
return text | return text | ||
end | |||
}, | |||
["vide"] = { | |||
warning = true, | |||
category = 'Sections vides ou incomplètes', | |||
text = function(args) | |||
local text = 'Cette rubrique est vide, insuffisamment détaillée ou incomplète. [' | |||
.. mw.title:getCurrentTitle():fullUrl('action=edit') .. ' Votre aide] est la bienvenue' | |||
local todo = args['à faire'] | |||
if todo then | |||
text = text .. ' pour ' .. todo | |||
end | |||
return text .. '.' | |||
end | |||
}, | |||
} | } | ||
Ligne 174 : | Ligne 95 : | ||
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 and mw.title.getCurrentTitle().namespace == 0 then | if category ~= '' and mw.title.getCurrentTitle().namespace == 0 then | ||
local game = args['jeu'] | local game = args['jeu'] | ||
if game ~= '' then | if game ~= '' then | ||
game = require( 'Module:Abréviation' ).name(game) or '' | game = require( 'Module:Abréviation' ).name(game) or '' | ||
Ligne 187 : | Ligne 108 : | ||
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 203 : | Ligne 123 : | ||
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() | ||