Content deleted Content added
? :D D: Tag: Reverted |
No edit summary |
||
(20 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 152:
builder = builder:tag('table')
:addClass(data.i18n.class.aggregators)
local caption = data.i18n[aggregatorCount == 1 and 'aggregateScore' or 'aggregateScores']▼
▲
:wikitext(caption)▼
:done()
if #activeSystems ~= 0 then
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 191:
builder = builder:tag('table')
:addClass(data.i18n.class.reviews)
:addClass(data.i18n.class.wikitable)
:done()▼
▲ if priorReviewCount > 0 then builder:addClass(data.i18n.class.stacked) end
if #activeSystems ~= 0 then
Line 204 ⟶ 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 216 ⟶ 214:
end
else
renderHeadingRow(builder, data.i18n.display.publication)
for _, v in ipairs(providedReviewers) do
renderRating(builder, data.reviewers[v].name, args[v])
Line 231 ⟶ 229:
builder = builder:tag('table')
:addClass(data.i18n.class.awards)
:addClass(data.i18n.class.wikitable)
:wikitext(data.i18n.display[#awardKeys == 1 and 'award' or 'awards'])
▲ if priorReviewCount > 0 then builder:addClass(data.i18n.class.stacked) end
builder:tag('tr')▼
:tag('th')▼
:attr('scope', 'col')▼
:wikitext(data.i18n.publication)▼
▲ :done()
:tag('th')▼
:attr('scope', 'col')▼
:wikitext(data.i18n.award)▼
:done()
▲ :tag('th')
▲ :attr('scope', 'col')
▲ :wikitext(data.i18n.display.publication)
▲ :tag('th')
▲ :attr('scope', 'col')
▲ :wikitext(data.i18n.display.award)
for _, v in ipairs(awardKeys) do
Line 262 ⟶ 258:
end
local function renderEditOnWikidata(
if not wikidata
:addClass(data.i18n.class.wikidata)
:wikitext(
:done()
▲ div:done()
end
local function categorizePlatformCount(builder, platformCount)
if
else
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 302 ⟶ 295:
local function render(providedReviewers, providedAggregators, awardKeys,
activeSystems, customAggregatorKeys, customReviewerKeys, args, wikidata)
local is_collapsible = args.title and args.state and
(args.state == data.i18n.state.autocollapse or
▲ )
local div = mw.html.create('div')
:attr('role', 'complementary')
:addClass(data.i18n.class.container)
:addClass(#activeSystems == 0 and data.i18n.class.containersingle or nil)
:addClass(args.align == data.i18n.align.left and data.i18n.class.containerleft or nil)
if args.align then▼
end▼
▲ div:addClass(data.i18n.class.containersingle)
▲ or args.state == 'collapsed' or args.state == 'expanded') then
▲ :addClass('mw-collapsible')
▲ if args.state == 'collapsed' then
renderTitles(div, args.title, args.subtitle)
Line 356 ⟶ 337:
reviewerCount + aggregatorCount
)
renderEditOnWikidata(div, wikidata, args.state)
categorizePlatformCount(div, #activeSystems)▼
wikidata,▼
▲ categorizePlatformCount(activeSystems)
return div
Line 369 ⟶ 345:
local function checkForWikidata(frame, args, activeSystems, providedAggregators)
local wikidata = false
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 434 ⟶ 414:
))
elseif mw.title.getCurrentTitle().namespace == 0 then
return data.i18n.
end
end
Line 442 ⟶ 422:
getArgs = require('Module:Arguments').getArgs
end
return p._reviewbox(frame, getArgs(frame,
{ wrappers = data.i18n.wrapper, trim = false, translate = data.argi18n } )) end
|