সমললৈ যাওক

Module:Infobox road

অসমীয়া ৱিকিপিডিয়াৰ পৰা

Documentation for this module may be created at Module:Infobox road/doc

local p = {}
local getArgs = require('Module:Arguments').getArgs

function p.headerStyle(frame)
	local args = getArgs(frame)
	local deleted = args.decommissioned or args.deleted
	if deleted then
		return "background:#AAA;"
	end
	local colors = require"Module:Infobox road/color"
	return colors.color(frame)
end

local function browse(args)
	if args.nobrowse then return nil end
	
	local previousRoute = args.previous_route
	local nextRoute = args.next_route
	if previousRoute or nextRoute then
		local box = mw.html.create('table'):cssText("width:100%; background:none; border-collapse:collapse")
		local boxModule = require "Module:Road data/browse"
		local primary = boxModule._browse(args)
		box:wikitext(primary)
		return tostring(box)
	end
end

function p.browse(frame)
	local args = getArgs(frame)
	return browse(args)
end

local function extended(args)
	local extended = args.browse
	if args.nobrowse or extended == nil then
		return nil 
	else
		local box = mw.html.create('table'):cssText("width:100%; background:none; border-collapse:collapse")
		box:wikitext(extended)
		return tostring(box)
	end
end

function p.extended(frame)
	local args = getArgs(frame)
	return extended(args)
end

return p