Modul:Saison: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 2: | Zeile 2: | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
-- Parameter auslesen | |||
local titel = args.titel or "" | local titel = args.titel or "" | ||
local bild = args.bild or "" | |||
local bildbeschreibung = args.bildbeschreibung or "" | |||
local beruf = args.beruf or "" | local beruf = args.beruf or "" | ||
local geburt = args.geburt or "" | local geburt = args.geburt or "" | ||
local geburtsort = args.geburtsort or "" | |||
local land = args.land or "" | |||
-- Infobox erstellen | |||
local box = mw.html.create("table") | local box = mw.html.create("table") | ||
:addClass("infobox") | :addClass("infobox") | ||
box | -- Titel | ||
:tag(" | if titel ~= "" then | ||
:wikitext( | box | ||
:tag("caption") | |||
:wikitext(titel) | |||
:done() | |||
end | |||
-- Bild | |||
if bild ~= "" then | |||
local bildzeile = box | |||
:tag("tr") | |||
bildzeile | |||
:tag("td") | |||
:attr("colspan", "2") | |||
:addClass("infobox-bild") | |||
:wikitext("[[Datei:" .. bild .. "|250px]]") | |||
:done() | |||
bildzeile:done() | |||
-- Bildbeschreibung | |||
if bildbeschreibung ~= "" then | |||
box | |||
:tag("tr") | |||
:tag("td") | |||
:attr("colspan", "2") | |||
:addClass("infobox-bild") | |||
:wikitext(bildbeschreibung) | |||
:done() | |||
:done() | |||
end | |||
end | |||
-- Beruf | |||
if beruf ~= "" then | if beruf ~= "" then | ||
box | box | ||
| Zeile 27: | Zeile 67: | ||
end | end | ||
-- Geburtsdatum | |||
if geburt ~= "" then | if geburt ~= "" then | ||
box | box | ||
| Zeile 35: | Zeile 76: | ||
:tag("td") | :tag("td") | ||
:wikitext(geburt) | :wikitext(geburt) | ||
:done() | |||
:done() | |||
end | |||
-- Geburtsort | |||
if geburtsort ~= "" then | |||
box | |||
:tag("tr") | |||
:tag("th") | |||
:wikitext("Geburtsort") | |||
:done() | |||
:tag("td") | |||
:wikitext(geburtsort) | |||
:done() | |||
:done() | |||
end | |||
-- Land | |||
if land ~= "" then | |||
box | |||
:tag("tr") | |||
:tag("th") | |||
:wikitext("Land") | |||
:done() | |||
:tag("td") | |||
:wikitext(land) | |||
:done() | :done() | ||
:done() | :done() | ||