Content deleted Content added
add wikitable; and nil is fun |
No edit summary |
||
(11 intermediate revisions by 6 users not shown) | |||
Line 1:
require('
local p = {}
Line 89:
:attr('scope', 'colgroup')
:attr('colspan', #activeSystems)
:wikitext(data.i18n.display.score)
:done()
builder = builder:tag('tr')
Line 109:
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.display.score)
:done()
end
Line 128:
cell
:addClass(data.i18n.class.na)
:wikitext(data.i18n.display.na)
:done()
end
Line 155:
:addClass(args.state and 'mw-collapsible-content' or nil)
:tag('caption')
:wikitext(data.i18n.display[aggregatorCount == 1 and 'aggregateScore' or 'aggregateScores'])
:done()
Line 162:
local showplatforms = #activeSystems ~= 1 or yesno(args.showplatforms)
if showplatforms then
renderHeadingRowWithSystems(builder, activeSystems, data.i18n.display.aggregator)
else
renderHeadingRow(builder, data.i18n.display.aggregator)
end
Line 174:
end
else
renderHeadingRow(builder, data.i18n.display.aggregator)
for _, v in ipairs(providedAggregators) do
renderRating(builder, data.aggregators[v].name, args[v])
Line 194:
:addClass(args.state and 'mw-collapsible-content' or nil)
:tag('caption')
:wikitext(data.i18n.display[reviewerCount == 1 and 'reviewScore' or 'reviewScores'])
:addClass(priorReviewCount > 0 and data.i18n.class.stacked or nil)
:done()
Line 202:
local showplatforms = #activeSystems ~= 1 or yesno(args.showplatforms)
if showplatforms then
renderHeadingRowWithSystems(builder, activeSystems, data.i18n.display.publication)
else
renderHeadingRow(builder, data.i18n.display.publication)
end
Line 214:
end
else
renderHeadingRow(builder, data.i18n.display.publication)
for _, v in ipairs(providedReviewers) do
renderRating(builder, data.reviewers[v].name, args[v])
Line 232:
:addClass(args.state and 'mw-collapsible-content' or nil)
:tag('caption')
:wikitext(data.i18n.display[#awardKeys == 1 and 'award' or 'awards'])
:addClass(priorReviewCount > 0 and data.i18n.class.stacked or nil)
:done()
Line 238:
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.display.publication)
:done()
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.display.award)
:done()
Line 264:
:addClass(data.i18n.class.wikidata)
:addClass(state and 'mw-collapsible-content' or nil)
▲ :wikitext(data.i18n.editOnWikidata .. vgwd.getUpdateLink('nosub'))
:done()
end
Line 271 ⟶ 270:
local function categorizePlatformCount(builder, platformCount)
if platformCount ~= 0 then
builder:wikitext(data.i18n.
else
builder:wikitext(data.i18n.
end
end
local function renderTitles(builder, title, subtitle)
builder:tag('div')
:addClass(data.i18n.class.title)
:wikitext(title or data.i18n.display.reception)
:done()
Line 300 ⟶ 298:
(args.state == data.i18n.state.autocollapse or
args.state == data.i18n.state.collapsed or
args.state == data.i18n.state.expanded
)
local div = mw.html.create('div')
:attr('role', 'complementary')
:addClass(data.i18n.class.container)
:addClass(#activeSystems == 0 and data.i18n.class.containersingle or nil)
Line 310 ⟶ 309:
:addClass(is_collapsible and args.state == data.i18n.state.collapsed and 'mw-collapsed' or nil)
:addClass(is_collapsible and args.state == data.i18n.state.autocollapse and args.state or nil)
renderTitles(div, args.title, args.subtitle)
Line 340 ⟶ 338:
)
renderEditOnWikidata(div, wikidata, args.state)
categorizePlatformCount(div, #activeSystems)
return div
Line 347 ⟶ 345:
local function checkForWikidata(frame, args, activeSystems, providedAggregators)
local wikidata = false
if args.qid == 'none' then
return wikidata
end
vgwd.setDateFormat(args
vgwd.setGame(args
vgwd.setSystem(nil)
vgwd.setGenerateReferences(true)
vgwd.setShowUpdateLink(false)
vgwd.setUpdateLinkStyle("text and pen")
vgwd.setSystemFormat(args
-- Loop through aggregators if we have any.
Line 412 ⟶ 414:
))
elseif mw.title.getCurrentTitle().namespace == 0 then
return data.i18n.
end
end
Line 420 ⟶ 422:
getArgs = require('Module:Arguments').getArgs
end
return p._reviewbox(frame, getArgs(frame,
{ wrappers = data.i18n.wrapper, trim = false, translate = data.argi18n } )) end
|