Modül:AttributePicker

FM Wiki sitesinden
08.53, 4 Aralık 2025 tarihinde 5.176.56.134 (mesaj) tarafından oluşturulmuş 55 numaralı sürüm
(fark) ← Önceki sürüm | Güncel sürüm (fark) | Sonraki sürüm → (fark)
Gezinti kısmına atla Arama kısmına atla

Bu modül için bir Modül:AttributePicker/belge belgelendirmesi oluşturabilirsiniz

local p = {}
local Attributes = require("Modül:FMAttributes")

function p.render(frame)
    local bindName = frame.args.bind or "attributes"

    -- table oluştur
    local root = mw.html.create("tbody")

    -- başlık satırı
    local header = root:tag("tr")
    header:tag("td")
        :attr("colspan", "2")
        :cssText("font-size:12px;color:#555;")
        :wikitext("Seçim Yap:")

    for _, attr in ipairs(Attributes) do
        local row = root:tag("tr")

        -- checkbox hücresi
        local cell1 = row:tag("td")
        cell1:cssText("width:28px;text-align:center;padding:4px;")

        cell1:tag("input")
            :attr("type", "checkbox")
            :attr("name", bindName)
            :attr("value", attr)
            :addClass("attribute-select")

        -- attribute adı hücresi
        local cell2 = row:tag("td")
        cell2:wikitext(attr)
    end

    -- buton satırı
    local last = root:tag("tr")
    local bt = last:tag("td")
    bt:attr("colspan", "2")
    bt:cssText("text-align:center;padding:8px;")
    bt:tag("button")
        :addClass("attribute-generate")
        :attr("data-bind", bindName)
        :wikitext("Seçimi Uygula")

    return tostring(root)
end

return p