Jump to content

Module:Video game reviews

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Cky2250 (talk | contribs) at 01:38, 10 October 2013 (Start). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

--
-- This module will implement {{Video game multiple console reviews}}
--
local f = {}

local HtmlBuilder = require('Module:HtmlBuilder')

local args

--
-- Title row
--
function renderTitleRow(tbl)
    if not args.title then return end

    local titleRow = addTableRow(tbl)

    local titleCell = titleRow.tag('th').attr('scope', 'col')

    renderNavBar(titleCell)

    titleCell
        .tag('div')
        .addClass(args.title)
        .css('font-size', '100%')
        .newline()
        .wikitext(args.title)
end

--
-- Main tables

--

function renderMainTable()
    local tbl = HtmlBuilder.create('table')
        .attr('cellpadding', 0)
        .attr('cellspacing', 0)
        .addClass('nowraplinks')
        .addClass(args.bodyclass)

    if args.title and (args.state ~= 'plain' and args.state ~= 'off') then
        tbl
            .addClass('collapsible')
            .addClass(args.state or 'autocollapse')
    end

    tbl
        .css('align', 'right')

        .css('background', 'transparent')
        .css('padding', '0em')
        .css('margin-top', '0em')
        .css('margin', '1em')
        .css('text-align', 'center')
        .css('font-size', '80%')

    renderTitleRow(tbl)

    return tbl
end

return f