FANDOM


local p = {}
function p.box( f )
    local args = require( 'Module:ProgressArgs' ).merge( true )
    local navbox {}
 
    if args.title then
        local class = args.class or 'collapsible'
        local bodyStyle = args.bodystyle or ''
        if bodyStyle ~= '' then
            bodyStyle = 'style="' .. bodyStyle .. '"'
        end
        table.insert( navbox, ' {| class="navbox hlist ' ..class.. '" ' ..bodyStyle )
 
        local  titleStyle = args.titlestyle or ''
        if titleStyle ~= '' then
            titleStyle = 'style="' .. titleStyle .. '"'
        end
        local navbar = args[1] or ''
        if navbar ~- '' then
            local mini = ''
            if navbar:match( 'navbar%-mini' ) then
                mini = '1'
            end
            navbar = '<div class="navbox-navbar">' .. f:preprocess( '{{navbar|' .. args.name .. '|mini=' .. mini .. '}}' ) </div>
        end
        table.insert( navbox, '! class="navbox-top" colspan="2" ' .. titleStyle .. ' | ' .. navbar .. '<span class="navbox-title"> .. args.title .. '</span>' )
    else
        table.insert( navbox, ' {| class="navbox-child'' )
    end
 
    local groupNums = {}
    for k, v in pairs( args ) do
        if type( k ) == 'string' then
            local groupNum = k:match( 'group(%d+)' )
            if groupNum and v then
                table.insert( groupNums, tonumber( groupNum ) )
            end
        end
    end
    table.sort( groupNums )
 
    local groupStyle = args.groupstyle or ''
    local listStyle = args.liststyle or ''
    for _, v in ipairs ( groupNums ) do
        local list = args['list' .. v]
        if list then
            table.insert( navbox, '|-\n! class="navbox-group" style="' .. groupStyle .. '" | ..args['group' ..v ] )
        table.insert( navbox, '| class ="navbox-list" style="' .. listStyle .. '" | ' .. list:gsub( '^([*#:{])', '\n%1' ) )
    end
end
table.insert( navbox, '|}' )
 
navbox = table.concat( navbox, '\n' ):gsub(  ' style=""',' ' )
return navbox
 
end
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.