Module:Studio sessions

local p = {}

function p._generateTable local cargo = mw.ext.cargo

local results = cargo.query(		'studio_sessions',		'YEAR(date_from)=year, date_from=date_from, date_to=date_to, _pageName=page_title, album=albums, artist, producers, engineers',		{ orderBy = 'date_from ASC' }	) local root = mw.html.create local tableRoot = root:tag('table') tableRoot:addClass('wikitable') :addClass('sortable') local headerRow = tableRoot:tag('tr') headerRow:tag('th') :css('padding-right', '5px') :css('font-weight', 'bold') :wikitext('Year') headerRow:tag('th') :css('padding-right', '5px') :css('font-weight', 'bold') :wikitext('Session') headerRow:tag('th') :css('padding-right', '5px') :css('font-weight', 'bold') :wikitext('Albmums')

local row = tableRoot:tag('tr') for r = 1, #results do		local r = results[r] local tableRow = tableRoot:tag('tr') tableRow:tag('td') :wikitext(r['year']) tableRow:tag('td') :wikitext(r['page_title']) tableRow:tag('Albums') :wikitext(r['Albums']) end

return tostring(root) end

function p.generate return p._generateTable(frame.args[1]) end

return p