Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Navplate

From CaelemsWiki
Revision as of 00:23, 20 April 2023 by en>Alistair3149 (Created page with "-------------------------------------------------------------------------------- -- Module:Navplate -- -- This module implements {{Navplate}} -- -- This is a work in progress -- -------------------------------------------------------------------------------- local function addRow(rowArgs) -- Adds a row to the navplate, wit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Module:Navplate implements the {{navplate}} template.


--------------------------------------------------------------------------------
-- Module:Navplate                                                            --
-- This module implements {{Navplate}}                                        --
-- This is a work in progress                                                 --
--------------------------------------------------------------------------------

local function addRow(rowArgs)
    -- Adds a row to the navplate, with either a header cell
    -- or a label/data cell combination.
    if rowArgs.header then
        root
            :tag('div')
                :addClass('template-navplate__groupheader')
                :wikitext(rowArgs.header)
    elseif rowArgs.data then
        local row = root:tag('div')
        row:addClass('template-navplate-item')
        row
            :tag('div')
            	:addClass('template-navplate-item__label')
                :wikitext(rowArgs.label)
                :done()
        
        local dataCell = row:tag('div')
        dataCell
            :addClass('template-navplate-item__list')
            :wikitext(rowArgs.data)
    end
end