Module:RokkrSiegesTable

local Util = require 'Module:Util' local cargo = mw.ext.cargo local Datetime = require 'Module:DatetimeUtil' local p = {}

function p.main(frame) local tbl = mw.html.create("table") :addClass("wikitable") :addClass("default") :css("text-align","center") local header = tbl:tag("tr") header:tag("th") :wikitext("Image") header:tag("th") :wikitext("Page") header:tag("th") :wikitext("Event Dates") header:tag("th") :wikitext("Røkkr") for k,v in ipairs(cargo.query( "RokkrSieges=rs,RokkrSieges__Rokkrs=r", "rs._pageName=pgname,rs.Image=img,GROUP_CONCAT(DISTINCT r._value SEPARATOR ',')=rlist,rs.StartTime=st,rs.EndTime=et", {			join = "rs._ID=r._rowID", orderBy = "rs.Number", groupBy="rs._pageName", limit=9000 }	)) do		local row = tbl:tag("tr") local rokkrs = {} row:tag("td"):wikitext("") row:tag("td"):wikitext(""..v["pgname"].."") row:tag("td"):wikitext(Datetime.ht_range(v.st, v.et)) for r in mw.text.gsplit(v["rlist"], ",") do			rokkrs[#rokkrs+1] = frame:expandTemplate{ title = "Ui", args = { name = r, size = "52px" } } end row:tag("td"):wikitext(table.concat(rokkrs, " ")) end return tbl end return p