Module:Video game reviews/sandbox: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
reduce scope of custome_agg and custome_rev
Jackmcbarn (talk | contribs)
reduce scope of args
Line 22:
local HtmlBuilder = require('Module:HtmlBuilder')
local categoryHandler = require('Module:Category handler').main
 
local args
 
local function Split(str, delim)
Line 58 ⟶ 56:
end
 
local function renderTitleRow(tbl, args)
local titleCell = tbl.tag('tr').tag('th').css('font-size', '120%')
 
Line 86 ⟶ 84:
end
 
local function reviews(halfkeysrev, halfkeysagg, platforms, custome_agg, custome_rev, args)
local arg_system
local tbl2
Line 378 ⟶ 376:
end
 
local function appendAwardRow(tbl, awardnum, args)
tbl.tag('tr')
.tag('td')
Line 390 ⟶ 388:
end
 
local function awards(args, awardnums, args)
if args['award1'] then
local Cell = HtmlBuilder.create('table')
Line 413 ⟶ 411:
 
for _,v in ipairs(awardnums) do
appendAwardRow(Cell, v, args)
end
return Cell
Line 419 ⟶ 417:
end
 
local function renderMainTable(halfkeysrev, halfkeysagg, awardnums, platforms, custome_agg, custome_rev, args)
local tbl
 
Line 466 ⟶ 464:
tbl.css('float', args.align or 'right').css('clear', args.align or 'right')
 
renderTitleRow(tbl, args)
 
tbl
.tag('tr')
.tag('td')
.node(reviews(halfkeysrev, halfkeysagg, platforms, custome_agg, custome_rev, args))
 
tbl
.tag('tr')
.tag('td')
.node(awards(args, awardnums, args))
else
local category = categoryHandler{
Line 488 ⟶ 486:
end
 
function p._reviewbox(reviewBoxArgsargs)
local halfkeysrev, halfkeysagg
local flags = {}
Line 495 ⟶ 493:
local awardnums = {}
local j = 1
args = reviewBoxArgs
local activeSystems = getActiveSystems(args)
local platforms = #activeSystems
Line 568 ⟶ 565:
if awardnums then table.sort(awardnums) end
 
return renderMainTable(halfkeysrev, halfkeysagg, awardnums, platforms, custome_agg, custome_rev, args)
end