Module:Sidebar: Difference between revisions

Ganaram inukshuk (talk | contribs)
m update todo; float already works
Ganaram inukshuk (talk | contribs)
m add name, pulled from args
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]
-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]
local getArgs = require("Module:Arguments").getArgs
local getArgs = require("Module:Arguments").getArgs
local navbar  = require("Module:Navbar")._navbar
local tiu    = require("Module:Template input utils")
local tiu    = require("Module:Template input utils")


Line 19: Line 20:
local footer = args["Footer Row"]
local footer = args["Footer Row"]
local float  = args["float"] or "right"
local float  = args["float"] or "right"
local name  = args["name"]
-- Helper function; title
-- Helper function; title
Line 41: Line 43:
table.insert(lines, "|-")
table.insert(lines, "|-")
table.insert(lines, string.format('| style="font-size: 80%%;" | %s', row_content))
table.insert(lines, string.format('| style="font-size: 80%%;" | %s', row_content))
return table.concat(lines, "\n")
end
-- Helper function; navbar row
function navbar_row()
local lines = {}
table.insert(lines, '|-')
table.insert(lines, '| style="text-align: center;" | ' .. navbar(name, "mini", ""))
return table.concat(lines, "\n")
return table.concat(lines, "\n")
end
end
Line 61: Line 72:
-- Footer
-- Footer
if footer then table.insert(lines, header_footer_row(footer)) end
if footer then table.insert(lines, header_footer_row(footer)) end
if name then table.insert(lines, navbar_row()) end
-- End of table
-- End of table