Module:Bandeau de source
La documentation pour ce module peut être créée à Module:Bandeau de source/doc
local p = {}
function p.build(frame)
local args = require( 'Module:Outils' ).extractArgs( frame )
local bannerType = args[1] or ''
local source = args['source'] or 'source ?'
local link = args['lien'] or ''
local image = args['image'] or 'bandeau de source - defaut.png'
local text = args['texte'] or ''
local bannerText = ''
if bannerType == 'fin' then
bannerText = 'Fin des informations basées sur ' .. source .. '.'
else
bannerText = 'Les informations suivantes se basent sur ' .. source
if text == 'vide' then
bannerText = bannerText .. '.'
elseif text == 'contradiction' then
bannerText = bannerText .. ' et sont contredites par les sources officielles.'
elseif text == 'avant-première' then
bannerText = bannerText .. ' et peuvent être inexactes ou contenir des \'\'spoilers\'\'.'
elseif text == 'semi' then
bannerText = bannerText .. ' et peuvent être contredites par les sources officielles.'
else
bannerText = bannerText .. ' et n\'ont pas été confirmées par des sources officielles.'
end
end
return mw.html.create( 'div' )
:addClass( 'avt-source-banner' )
:tag( 'div' )
:addClass( 'avt-source-banner-img' )
:wikitext( '[[Fichier:' .. image .. '|x25px|link=' .. link .. '|alt=]]' )
:done()
:tag( 'p' )
:addClass( 'avt-source-banner-text' )
:wikitext( bannerText )
:allDone()
end
return p