Modül:Lawbox
Bu modül için bir Modül:Lawbox/belge belgelendirmesi oluşturabilirsiniz
local p = {}
function p.main(frame)
local args = frame:getParent().args
local title = args["başlık"] or "Kanun Bilgileri"
local html = mw.html.create("table"):addClass("lawbox")
html:tag("caption"):wikitext(title):done()
local rows = {
{"Kanun No", args["no"]},
{"Kabul Tarihi", args["kabul"]},
{"Yürürlük Tarihi", args["yürürlük"]},
{"Durum", args["durum"]},
{"İlgili Mevzuat", args["mevzuat"]}
}
-- 🔗 Resmî Gazete alanını kontrol et
local rg = args["resmigazete"]
if rg and rg ~= "" then
local ok, rgMod = pcall(require, "Module:ResmîGazete")
if ok and rgMod and type(rgMod.link) == "function" then
-- 🔧 DÜZELTME: Lua modülün parametreyi frame.args[1] olarak bekliyor
local link = rgMod.link({ args = { [1] = rg } })
table.insert(rows, {"Resmî Gazete", link})
else
table.insert(rows, {"Resmî Gazete", rg})
end
end
for _, row in ipairs(rows) do
if row[2] and row[2] ~= "" then
local tr = html:tag("tr")
tr:tag("th"):wikitext(row[1])
tr:tag("td"):wikitext(row[2])
end
end
return tostring(html)
end
return p