local p = {}
local htm = require("Modul:HTML")
local zeilen =
{ { "Wartungsmeldung", "Kategorie", "KlassenName", "Ehemals", "Anzahl"},
{ ["Wartungsmeldung"] = "Datei-Freiattribut-Fehler", ["Kategorie"] = "", ["KlassenName"] = "", ["Ehemals"] = ""},
}
function p.Wartungstabelle(frame)
local t = ""
for i, z in ipairs(zeilen) do
if i == 1 then
-- Tabellen-Überschrift
t = t .. htm.tableHeader(z)
else
-- Tabellen-Zeile
-- Anzahl ermitteln
local query = ""
for _, s in ipairs(zeilen[1]) do
if z[s] ~= "" and s ~= "Anzahl" then
query = query .. "[[" .. s .. "::" .. z[s] .. "]]"
end
end
query = query .. "|format=count"
z["Anzahl"] = mw.smw.ask(query)
-- Zeile zusammenbauen
local line = {}
for _, s in ipairs(zeilen[1]) do
if z[s] == "" then
z[s] = "(alle)"
end
table.insert(line, z[s])
end
t = t .. htm.tableLine(line)
end
end
-- Tabellen-Fuß
t = t .. htm.tableFooter()
return t
end
return p