Module:Video game reviews/sandbox: Difference between revisions

Content deleted Content added
clean
move css
Line 80:
local function renderMainHeading(builder, colspan, headingText, borderTop)
builder:tag('tr')
:addClass('vgr-main-heading')
:tag('th')
:attr('colspan', colspan)
:attr('scope', colspan == 1 and 'col' or 'colgroup')
:css('background', '#d1dbdf')
:css('border-top', borderTop)
:wikitext(headingText)
Line 91 ⟶ 92:
renderMainHeading(builder, #activeSystems + 1, mainHeading)
builder:tag('tr')
:addClass('vgr-systems')
:tag('th')
:attr('rowspan', '2')
:cssattr('backgroundscope', '#e8f4f8col')
:css('text-align', 'center')
:css('vertical-align', 'middle')
:wikitext(data.i18n.publication)
:done()
:tag('th')
:attr('colspan', #activeSystems)
:attr('scope', #activeSystems == 1 and 'col' or 'colgroup')
:css('background', '#e8f4f8')
:css('vertical-align', 'middle')
:wikitext(data.i18n.score)
:done()
builder = builder:tag('tr')
for _, v in ipairs(activeSystems) do
builder:tag('th')
:wikitext(data.systems[v].name)
:cssattr('widthscope', '100%col')
:done()
end
end
Line 113 ⟶ 115:
renderMainHeading(builder, 2, mainHeading)
builder:tag('tr')
:addClass('vgr-hrow')
:tag('th')
:css('background', '#e8f4f8')
:css('text-align', 'center')
:css('vertical-align', 'middle')
:wikitext(nameHeading)
:cssattr('marginscope', '0emcol')
:done()
:tag('th')
:css('background', '#e8f4f8')
:css('vertical-align', 'middle')
:wikitext(data.i18n.score)
:cssattr('marginscope', '0col')
:done()
end
 
local function renderRatingsBySystem(builder, code, name, activeSystems, args, na)
builder = builder:tag('tr'):addClass('vgr-ratings')
builder:tag('td')
:css('vertical-align', 'middle')
:wikitext(name)
 
Line 137 ⟶ 136:
if args[combinedCode] then
cell
:css('vertical-align', 'middle')
:css('text-align', 'center')
:wikitext(args[combinedCode])
:done()
elseif na then
cell
:css('color', '#707070')
:css('vertical-align', 'middle')
:css('text-align', 'center')
:addClass('table-na')
:wikitext(data.i18n.na)
Line 154 ⟶ 148:
 
local function renderRating(builder, name, rating)
builder:tag('tr'):addClass('vgr-rating')
:tag('td')
:css('text-align', 'center')
:css('vertical-align', 'middle')
:wikitext(name)
:done()
:tag('td')
:css('text-align', 'center')
:wikitext(rating)
:done()
Line 169 ⟶ 160:
activeSystems, customAggregatorKeys, customReviewerKeys, args)
builder = builder:tag('table')
:attraddClass('cellpaddingvgr-reviews', 0)
:attr('cellspacing', 0)
:css('width', '100%')
:css('border-bottom', 'none')
:css('margin', '0em')
if args.state then builder:addClass('mw-collapsible-content') end
 
Line 239 ⟶ 226:
local function renderAwards(builder, args, awardKeys, borderTop)
builder = builder:tag('table')
:cssaddClass('width', '100%vgr-awards')
:css('margin', '0')
:css('border-top', borderTop)
:attr('cellpadding', 3)
:attr('cellspacing', 0)
if args.state then builder:addClass('mw-collapsible-content') end
 
Line 251 ⟶ 235:
:tag('th')
:wikitext(data.i18n.publication)
:attr('cellpaddingscope', 3'col')
:done()
:tag('th')
:wikitext(data.i18n.award)
:attr('cellspacingscope', 0'col')
:done()
 
for _, v in ipairs(awardKeys) do
builder:tag('tr')
:tag('td')
:css('font-weight', 'bold')
:css('background-color', '#f2f2f2')
:wikitext(args[v .. 'Pub'])
:done()
:tag('td')
:css('background-color', '#f2f2f2')
:wikitext(args[v])
:done()
end
builder:done()
Line 402 ⟶ 387:
local providedReviewers, providedAggregators = getProvidedReviewersAndAggregators(args, #activeSystems ~= 0)
local wikidata = checkForWikidata(frame, args, activeSystems, providedAggregators)
if #customAggregatorKeys ~= 0 or #customReviewerKeys ~= 0 or
#providedAggregators ~= 0 or #providedReviewers ~= 0 or #awardKeys ~= 0 then
return frame:extensionTag{
name='templatestyles', args = { src = data.i18n.templatestyles }