Content deleted Content added
break all the pages |
let's see how broke this sandbox can be |
||
Line 2:
local p = {}
local data = require('Module:Video game reviews/data/sandbox')
local yesno = require('Module:Yesno')
local vgwd = require('Module:Video game wikidata')
Line 23:
local reviewers, aggregators, awards = {}, {}, {}
for k in pairs(args) do
if string.match(k,
table.insert(reviewers, k)
elseif string.match(k,
table.insert(aggregators, k)
elseif string.match(k,
table.insert(awards, k)
end
Line 76:
end)
return providedReviewers, providedAggregators
end▼
if title then▼
:wikitext(title)▼
:addClass('Reception')▼
:wikitext(data.i18n.reception)▼
end▼
end
local function renderMainHeading(builder, colspan, headingText, borderTop)
builder:tag('tr')
:tag('th') :done()
end
Line 102 ⟶ 91:
renderMainHeading(builder, #activeSystems + 1, mainHeading)
builder:tag('tr')
:done()
builder = builder:tag('tr')
for _, v in ipairs(activeSystems) do
Line 123 ⟶ 113:
renderMainHeading(builder, 2, mainHeading)
builder
:done()
end
Line 139 ⟶ 130:
builder = builder:tag('tr')
builder:tag('td')
for _, v in ipairs(activeSystems) do
Line 147 ⟶ 138:
if args[combinedCode] then
cell
:done()
elseif na then
cell
:done()
end
end
Line 163 ⟶ 156:
local function renderRating(builder, name, rating)
builder:tag('tr')
:done()
end
local function renderReviews(builder, providedReviewers, providedAggregators, activeSystems, customAggregatorKeys, customReviewerKeys, args)
builder = builder:tag('table')
:addClass('infobox wikitable')▼
:attr('cellpadding', 0)
:attr('cellspacing', 0)
Line 245 ⟶ 238:
local function renderAwards(builder, args, awardKeys, borderTop)
builder = builder:tag('table')
:addClass('infobox wikitable')▼
:css('width', '100%')
:css('margin', '
:css('border-top', borderTop)
:attr('cellpadding', 3)
Line 272 ⟶ 264:
:wikitext(args[v])
end
builder:done()
builder:done()
end
local function
activeSystems, customAggregatorKeys, customReviewerKeys, args, wikidata) local
:addClass('video-game-reviews')
if args.align == 'left' then
:css('margin', args.align and▼
▲ end
if #activeSystems == 0 then
div:addClass('vgr-single')
end
if args.title and args.state and (args.state == 'autocollapse'
or args.state == 'collapsed' or args.state == 'expanded') then
end
:done()
if args.subtitle then
:done()
end
renderReviews(
div, providedReviewers, providedAggregators, activeSystems, customAggregatorKeys, customReviewerKeys, args )
if #awardKeys ~= 0 then
local borderTop =
(#customAggregatorKeys ~= 0 or
#customReviewerKeys ~= 0 or
#providedAggregators ~= 0 or
#providedReviewers ~= 0
) and 'none' or nil
renderAwards(
div,
args,
awardKeys,
borderTop
)▼
end
if wikidata == true then
:addClass('vgr-edit-on-wikidata')
▲ :tag('table')
-- TODO: I think getUpdateLink can be made const in the other module.
▲ :addClass('infobox wikitable')
▲ :wikitext('Edit on Wikidata ' .. vgwd.getUpdateLink('nosub'))
end
return
end
Line 384 ⟶ 394:
return frame:extensionTag{
name='templatestyles', args = { src = data.i18n.templatestyles }
} .. tostring(render(
providedReviewers,
providedAggregators,
Line 394 ⟶ 403:
args,
wikidata
▲ )
elseif mw.title.getCurrentTitle().namespace == 0 then
return data.i18n.emptyCategory
|