Bureaucrats, Moderators (CommentStreams), Interface administrators, Push subscription managers, Suppressors, Administrators
13,382
edits
(try fix) |
(another AI fix) |
||
| Line 1: | Line 1: | ||
-- Module:Main_page | -- Module:Main_page | ||
-- IMProved Main Page | -- IMProved Main Page – FINAL FIXED VERSION | ||
-- Works on | -- Works on Main Page, Portals, and any content page | ||
local p = {} | local p = {} | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame.args | |||
local args = | |||
local header = args.header or '' | local header = args.header or '' | ||
local bodyclass = args.bodyclass or '' | local bodyclass = args.bodyclass or '' | ||
local above = args.above or '' | local above = args.above or '' | ||
local below = args.below or '' | local below = args.below or '' | ||
local content = {} | |||
-- Collect | -- Collect content1, content2, etc. | ||
for k, v in pairs(args) do | for k, v in pairs(args) do | ||
if type(k) == 'string' and k:match('^content%d+$') then | if type(k) == 'string' and k:match('^content%d+$') then | ||
| Line 21: | Line 20: | ||
end | end | ||
-- | -- If no content args, use unnamed args ({{{1}}}, {{{2}}}, etc.) | ||
if #content == 0 | if #content == 0 then | ||
for i = 1, 50 do | |||
local v = args[i] | |||
if not v or v == '' then break end | |||
table.insert(content, v) | |||
table.insert(content, | |||
end | end | ||
end | end | ||
| Line 54: | Line 46: | ||
end | end | ||
-- | -- Grid container | ||
local container = html:tag('div') | local container = html:tag('div') | ||
:addClass('mp-container') | :addClass('mp-container') | ||
| Line 67: | Line 59: | ||
}) | }) | ||
-- Add | -- Add boxes | ||
for _, box in ipairs(content) do | for _, box in ipairs(content) do | ||
if box and box ~= '' then | if box and box ~= '' then | ||