Content deleted Content added
m formatting cleanup |
sync to live |
||
Line 2:
local p = {}
local data = require('Module:Video game reviews/data
local yesno = require('Module:Yesno')
local vgwd = require('Module:Video game wikidata
local getArgs
Line 34:
return tonumber(a:match('%d+')) < tonumber(b:match('%d+'))
end
table.sort(reviewers, comparator)
table.sort(aggregators, comparator)
Line 79 ⟶ 78:
end
local function
local
:css('font-weight', 'bold')▼
if title then
titleCell
:wikitext(title)
else
titleCell
:addClass('Reception')
:wikitext(data.i18n.reception)
end
end
local function
builder:tag('
:
:css('background', '#d1dbdf')
:css('border-top', borderTop
▲ :wikitext(captionText)
end
local function renderHeadingRowWithSystems(builder,
renderMainHeading(builder, #activeSystems + 1, mainHeading)
builder:tag('tr')
:tag('th')
:css('vertical-align', 'middle')▼
:done()
▲ :wikitext(data.i18n.publication)
:
:attr('colspan', #activeSystems)
:css('background', '#e8f4f8')▼
▲ :wikitext(data.i18n.score)
builder = builder:tag('tr')
for _, v in ipairs(activeSystems) do
builder:tag('th'):wikitext(data.systems[v].name)
:attr('scope', 'col')▼
:wikitext(data.systems[v].name)▼
end
end
local function renderHeadingRow(builder,
builder
:tag('tr') :tag('th')
:attr('scope', 'col')▼
:css('background', '#e8f4f8')
:css('text-align', 'center')
:css('vertical-align', 'middle')
:wikitext(nameHeading)
:done()
:tag('th')
:css('background', '#e8f4f8')
:css('vertical-align', 'middle')
Line 149 ⟶ 139:
builder = builder:tag('tr')
builder:tag('td')
:css('vertical-align', 'middle')
:wikitext(name)
for _, v in ipairs(activeSystems) do
Line 156 ⟶ 146:
local cell = builder:tag('td')
if args[combinedCode] then
cell
:css('vertical-align', 'middle') :wikitext(args[combinedCode])
elseif na then
cell
:css('color', '#707070') :css('vertical-align', 'middle')
:css('text-align', 'center')
:addClass('table-na')
:wikitext(data.i18n.na)
end
end
Line 170 ⟶ 163:
local function renderRating(builder, name, rating)
builder:tag('tr')
:tag('td')
:done()
:tag('td')
end
local function renderReviews(builder, providedReviewers, providedAggregators, activeSystems, customAggregatorKeys, customReviewerKeys, args)
builder = builder:tag('table')
:addClass('infobox wikitable')
:
:
:css('
:css('
local reviewerCount = #providedReviewers + #customReviewerKeys
Line 212 ⟶ 206:
if aggregatorCount ~= 0 then
if reviewerCount ~= 0 then
elseif showplatforms then
renderHeadingRowWithSystems(builder, aggregateScore, activeSystems)
Line 251 ⟶ 245:
local function renderAwards(builder, args, awardKeys, borderTop)
builder = builder:tag('table')
:addClass('infobox wikitable')
:css('width', '100%')
:css('margin', '0em')
:css('border-top', borderTop)
:
builder:tag('tr')
:tag('th')
:done()
▲ :wikitext(data.i18n.publication)
:
:wikitext(data.i18n.award)▼
for _, v in ipairs(awardKeys) do
builder:tag('tr')
:tag('td')
:done()
:tag('td')
end
end
local function renderMainTable(providedReviewers, providedAggregators, awardKeys, activeSystems, customAggregatorKeys, customReviewerKeys, args, wikidata)
local
:attr('
:attr('
:css('
:css('
'0em 1em 1em 1em')
:css('clear', args.align or 'right')
if #activeSystems == 0 then
-- Width: 20% Seems better since it scales with the article size.
tbl
▲ aside:css('width', args.width or '23em')
:css('width', args.width or '23em')
end
if args.title and args.state and (args.state == 'autocollapse'
or args.state == 'collapsed' or args.state == 'expanded') then
tbl
:addClass(
:addClass(args.state)
end
if args.subtitle then
end
renderReviews(
if #awardKeys ~= 0 then
renderAwards(
end
if wikidata == true then
▲ :wikitext(vgwd.getUpdateLink())
end
return
end
Line 342 ⟶ 337:
vgwd.setGenerateReferences(true)
vgwd.setShowUpdateLink(false)
vgwd.setUpdateLinkStyle("
vgwd.setSystemFormat(args["systemFormat"])
-- Loop through aggregators if we have any.
if #providedAggregators ~= 0 then
for
-- Check if vgwd knows this aggregator.
if vgwd.setReviewer(aggr) == nil then
-- Loop through active systems
if #activeSystems ~= 0 then
for
local combinedCode = aggr .. '_' .. sys
if args[combinedCode] == 'wikidata' then
|