705
modifications
Aucun résumé des modifications Balise : Révoqué |
Aucun résumé des modifications |
||
(7 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
local p = {} | local p = {} | ||
-- Types de bandeau | -- Types de bandeau autorisés | ||
local shapes = { | local shapes = { | ||
article = "banner-article", | article = "banner-article", | ||
note = "banner-note", | note = "banner-note", | ||
section = "banner-section", | section = "banner-section", | ||
simple = " | simple = "banner-simple", | ||
} | } | ||
-- | -- Niveaux d'information autorisés | ||
local levels = { | local levels = { | ||
ebauche = "banner-stub", | ebauche = "banner-stub", | ||
Ligne 59 : | Ligne 59 : | ||
:addClass(shape_class) | :addClass(shape_class) | ||
:addClass(level_class) | :addClass(level_class) | ||
:addClass("noexcerpt") | |||
local image = args.image | local image = args.image | ||
if image then | if image then | ||
local alt = args["image légende"] or "" | local alt = args["image légende"] or "" | ||
local size = args["image taille"] or | local size = args["image taille"] or default.image_size | ||
image = cells | image = cells | ||
:tag("div") | :tag("div") | ||
Ligne 78 : | Ligne 79 : | ||
:wikitext(title) | :wikitext(title) | ||
:done() | :done() | ||
if text then | |||
html_text | |||
:newline() | |||
:newline() | |||
:wikitext(text) | |||
end | |||
elseif text then | |||
html_text | html_text | ||
:newline() | :newline() | ||
:wikitext(text) | :wikitext(text) | ||
Ligne 113 : | Ligne 117 : | ||
title = string.format( | title = string.format( | ||
default.stub_title_subject, | default.stub_title_subject, | ||
subject. | subject.subject | ||
) | ) | ||
category = string.format( | category = string.format( | ||
Ligne 125 : | Ligne 129 : | ||
return p._banner({ | return p._banner({ | ||
forme = | forme = "article", | ||
niveau = | niveau = "ébauche", | ||
titre = title, | titre = title, | ||
texte = default.stub_text, | texte = default.stub_text, | ||
image = subject.image, | |||
["image taille"] = subject.size, | |||
}) .. category | }) .. category | ||
end | end | ||
function get_args(frame) | |||
local | local args = {} | ||
local argsParent = frame:getParent().args | |||
for cle, val in pairs(argsParent) do | |||
if val then | |||
args[cle] = mw.text.trim(val) | |||
end | |||
end | |||
return args | |||
end | |||
-- Fonctions destinées à être appelées dans les modèles | |||
function p.banner(frame) | function p.banner(frame) | ||
return p._banner(get_args(frame)) | |||
end | |||
function p.stub(frame) | |||
return p._stub(get_args(frame)) | |||
end | end | ||
return p | return p |