Modül:Lawbox: Revizyonlar arasındaki fark
Gezinti kısmına atla
Arama kısmına atla
"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ı kon..." içeriğiyle yeni sayfa oluşturdu |
Değişiklik özeti yok |
||
| (Aynı kullanıcının aradaki diğer 2 değişikliği gösterilmiyor) | |||
| 2. satır: | 2. satır: | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame:getParent().args | local args = frame:getParent() and frame:getParent().args or frame.args | ||
local title = args["başlık"] or "Kanun Bilgileri" | local title = args["başlık"] or "Kanun Bilgileri" | ||
| 16. satır: | 16. satır: | ||
} | } | ||
local rg = args["resmigazete"] | local rg = args["resmigazete"] | ||
local kaynakMetni = nil | |||
if rg and rg ~= "" then | if rg and rg ~= "" then | ||
local ok, rgMod = pcall(require, " | local ok, rgMod = pcall(require, "Modül:Resmigazete") | ||
if ok and rgMod and type(rgMod.link) == "function" then | if ok and rgMod and type(rgMod.link) == "function" then | ||
local link = rgMod.link({ args = { rg } }) | local link = rgMod.link({ args = { [1] = rg } }) | ||
table.insert(rows, {"Resmî Gazete", link}) | table.insert(rows, {"Resmî Gazete", link}) | ||
kaynakMetni = "Kaynak: Resmî Gazete" | |||
else | else | ||
table.insert(rows, {"Resmî Gazete", rg}) | table.insert(rows, {"Resmî Gazete", rg}) | ||
| 28. satır: | 30. satır: | ||
end | end | ||
for _, row in ipairs(rows) do | for _, row in ipairs(rows) do | ||
if row[2] and row[2] ~= "" then | if row[2] and row[2] ~= "" then | ||
| 35. satır: | 36. satır: | ||
tr:tag("td"):wikitext(row[2]) | tr:tag("td"):wikitext(row[2]) | ||
end | end | ||
end | |||
-- Eğer kaynak varsa tablo altına küçük puntolu dipnot ekle | |||
if kaynakMetni then | |||
local tr = html:tag("tr"):addClass("lawbox-footer") | |||
tr:tag("td") | |||
:attr("colspan", "2") | |||
:css("text-align", "center") | |||
:css("font-size", "85%") | |||
:css("color", "#555") | |||
:css("padding", "6px 0 2px 0") | |||
:css("font-style", "italic") | |||
:wikitext(kaynakMetni) | |||
end | end | ||
17.31, 10 Kasım 2025 itibarı ile sayfanın şu anki hâli
Bu modül için bir Modül:Lawbox/belge belgelendirmesi oluşturabilirsiniz
local p = {}
function p.main(frame)
local args = frame:getParent() and frame:getParent().args or frame.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"]}
}
local rg = args["resmigazete"]
local kaynakMetni = nil
if rg and rg ~= "" then
local ok, rgMod = pcall(require, "Modül:Resmigazete")
if ok and rgMod and type(rgMod.link) == "function" then
local link = rgMod.link({ args = { [1] = rg } })
table.insert(rows, {"Resmî Gazete", link})
kaynakMetni = "Kaynak: Resmî Gazete"
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
-- Eğer kaynak varsa tablo altına küçük puntolu dipnot ekle
if kaynakMetni then
local tr = html:tag("tr"):addClass("lawbox-footer")
tr:tag("td")
:attr("colspan", "2")
:css("text-align", "center")
:css("font-size", "85%")
:css("color", "#555")
:css("padding", "6px 0 2px 0")
:css("font-style", "italic")
:wikitext(kaynakMetni)
end
return tostring(html)
end
return p