Content deleted Content added
reduce amount of duplication needed |
add support for parameter "template"; clean up |
||
Line 11:
local function edit(frame, pagename)
return frame:expandTemplate{ title='edit', args
end
local function toolbox_template_row(frame, tbl, pagename)
local row = tbl:tag('tr')
row:tag('td')
:wikitext(frame:expandTemplate{ title='tl', args={ pagename } })
row:tag('td')
:wikitext(edit(frame, 'Template:' .. pagename))
end
Line 22 ⟶ 30:
end
local function toolbox_section(frame, args, tbl,
if row_function == nil then
toolbox_header_row(frame, tbl, title)▼
row_function = toolbox_row
end
local nums = {}
for k, _ in pairs(args) do
Line 32 ⟶ 42:
end
end
end
if #nums == 0 then
return
end
table.sort(nums)
for _, num in ipairs(nums) do
local arg_name = prefix .. num
Line 46 ⟶ 60:
right = edit(frame, pagename)
end
end
end
Line 60 ⟶ 74:
toolbox_row(frame, tbl, rootTitle.fullText, nil, edit(frame, rootTitle.fullText))
toolbox_section(frame, args, tbl
toolbox_section(frame, args, tbl
toolbox_section(frame, args, tbl
toolbox_section(frame, args, tbl, 'Other', 'other', '')
return tbl
end
|