Module:Video game reviews/sandbox: Difference between revisions

Content deleted Content added
this should just be tidying
Undid revision 993346459 by Izno (talk) nope, that one broke it, lets not revert all the way though
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 252 ⟶ 251:
:done()
end
builder:done()
builder:done()
end
 
Line 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'))
Line 294:
local function render(providedReviewers, providedAggregators, awardKeys,
activeSystems, customAggregatorKeys, customReviewerKeys, args, wikidata)
local is_collapsible = args.title and args.state and
(args.state == 'autocollapse' or args.state == 'collapsed' or args.state == 'expanded') then
local div = mw.html.create('div')
:addClass(data.i18n.class.container)
div:addClass(args.align == data.i18n.align.left and data.i18n.class.containerleft or nil)
:attr('role', 'figure')
div:addClass(args.align == data.i18n.align.none and data.i18n.class.containernone or nil)
div:addClass(#activeSystems == 0 and data.i18n.class.containersingle or nil)
if args.align then
div:addClass(is_collapsible and 'mw-collapsible' or nil)
if args.align == data.i18n.align.left then
:addClass((is_collapsible and args.state == 'collapsed') and 'mw-collapsed' or nil)
div:addClass(data.i18n.class.containerleft)
elseif:addClass((is_collapsible and (args.state == 'autocollapse' or args.state == 'expanded' then))
elseif args.align == data.i18n.align.none then
:css('width',and args.widthstate or nil)
div:addClass(data.i18n.class.containernone)
:css('width', #activeSystems == 0 and args.width or nil)
end
end
if #activeSystems == 0 then
div:addClass(data.i18n.class.containersingle)
:css('width', args.width or nil)
end
 
if args.title and args.state and (args.state == 'autocollapse'
or args.state == 'collapsed' or args.state == 'expanded') then
div:addClass('mw-collapsible')
if args.state == 'collapsed' then
div:addClass('mw-collapsed')
elseif args.state == 'autocollapse' or args.state == 'expanded' then
div:addClass(args.state)
end
end
 
renderTitles(div, args.title, args.subtitle)