Module:ItemTables: Difference between revisions

Jump to navigation Jump to search
Vergir (talk | contribs)
1) refactor a bit to use GameData module. 2) Update fire rate stat to better include Burst Fire
Vergir (talk | contribs)
1) Make ItemTables more mobile-friendly with classes. 2) add disclaimer about list being automatic.
Line 194: Line 194:


local createTable = mw.html.create('table')
local createTable = mw.html.create('table')
:addClass('wikitable sortable')
    :addClass('wikitable sortable item-stat-table')
:tag('caption'):wikitext("List of items"):done()
    :tag('caption'):done()


local soulIcon = frame:expandTemplate{ title = 'Souls' }
local soulIcon = frame:expandTemplate{ title = 'Souls' }
Line 275: Line 275:
end
end


for _, row in ipairs(requirements) do
    for _, row in ipairs(requirements) do
createTable:node(row)
        createTable:node(row)
end
    end
 
    local edit_url = mw.uri.fullUrl("Module:ItemTables", { action = "edit" })
    local disclaimer = frame:preprocess(
        '<div class="item-stat-table-disclaimer">'
        .. "This is an automatic list. "
        .. "[" .. tostring(edit_url) .. " Click here]"
        .. " to add notes or correct the contents."
        .. "</div>"
    )


return tostring(createTable)
    return disclaimer .. tostring(createTable)
end
end


return p
return p