Module:Video game reviews/sandbox: Difference between revisions

Content deleted Content added
make it happy?
this should just be tidying
Line 91:
:wikitext(data.i18n.score)
:done()
builder = builder :tag('tr')
for _, v in ipairs(activeSystems) do
builder:tag('th')
Line 114:
 
local function renderRatingsBySystem(builder, code, name, activeSystems, args, na)
builder = builder:tag('tr')
builder :tag('td')
:wikitext(name)
:done()
 
for _, v in ipairs(activeSystems) do
Line 152 ⟶ 153:
builder = builder:tag('table')
:addClass(data.i18n.class.aggregators)
if :addClass(args.state thenand builder:addClass('mw-collapsible-content') endor nil)
builder :tag('caption')
local caption = :wikitext(data.i18n[aggregatorCount == 1 and 'aggregateScore' or 'aggregateScores'])
builder:tag('caption')
:wikitextdone(caption)
:done()
 
if #activeSystems ~= 0 then
Line 191:
builder = builder:tag('table')
:addClass(data.i18n.class.reviews)
if :addClass(args.state thenand builder:addClass('mw-collapsible-content') endor nil)
builder :tag('caption')
 
local caption = :wikitext(data.i18n[reviewerCount == 1 and 'reviewScore' or 'reviewScores'])
:addClass(priorReviewCount > 0 and data.i18n.class.stacked or nil)
local stacked =
:done()
builder:tag('caption')
:wikitext(caption)
:addClass(priorReviewCount > 0 and data.i18n.class.stacked or nil)
:done()
if #activeSystems ~= 0 then
Line 231 ⟶ 228:
builder = builder:tag('table')
:addClass(data.i18n.class.awards)
if :addClass(args.state thenand builder:addClass('mw-collapsible-content') endor nil)
:wikitexttag('caption')
:wikitext(data.i18n[#awardKeys == 1 and 'award' or 'awards'])
builder:tag('caption')
:addClass(priorReviewCount > 0 and data.i18n.class.stacked or nil)
:wikitext(data.i18n[#awardKeys == 1 and 'award' or 'awards'])
:addClass(priorReviewCount > 0 and data.i18n.class.stacked or nil)
:done()
builder:tag('tr')
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.publication)
:done()
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.award)
:done()
builder :tag('tr')
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.publication)
:done()
:tag('th')
:attr('scope', 'col')
:wikitext(data.i18n.award)
:done()
 
for _, v in ipairs(awardKeys) do
Line 257 ⟶ 252:
:done()
end
builder:done():done()
builder:done()
end
 
Line 266 ⟶ 260:
builder:tag('div')
:addClass(data.i18n.class.wikidata)
:addClass(args.state and 'mw-collapsible-content' or nil)
-- TODO: I think getUpdateLink can be made const in the other module.
:wikitext(data.i18n.editOnWikidata .. vgwd.getUpdateLink('nosub'))
:done()
if state then builder:addClass('mw-collapsible-content') end
builder:done()
end
 
Line 303 ⟶ 296:
local div = mw.html.create('div')
:addClass(data.i18n.class.container)
:attr('role', 'figure')
if args.align then
Line 319 ⟶ 313:
if args.title and args.state and (args.state == 'autocollapse'
or args.state == 'collapsed' or args.state == 'expanded') then
if state then builder div:addClass('mw-collapsible-content') end
div
:addClass('mw-collapsible')
if args.state == 'collapsed' then
div:addClass('mw-collapsed')