Module:Infobox road/sandbox: Difference between revisions

Content deleted Content added
fix
test system links
Line 304:
end
 
--BROWSE HIGHWAY SYSTEM LINKS
 
local function browseLinkssystem(args)
if args.nobrowsesystem1 then return nil end
local infobox_args = {
local ntitle = parser(args, 'nbrowse') or nil
['child'] = "yes",
local nlist = parser(args, 'nbrowselinks') or nil
['decat'] = "yes",
local title = parser(args, 'browse') or nil
}
local list = parser(args, 'browselinks') or nil
local i = 1
if not ntitle and not title then
while (1) do
return nil end
local systemClassn = "header" .. i
local systemDatan = "data" .. i
local box = mw.html.create('div'):addClass("hlist")
local systemArgn = args['system' .. i]
if ntitle ~= nil then
box:tag('div'):cssText("font-weight: bold"):wikitext(ntitle )
infobox_args[systemClassn] = "hlist"
infobox_args[systemDatan] = systemArgn
if nlist ~= nil then
local nlinks = mw.html.create('ul')
forif i,v in== pairs(nlist)10 dothen
endbreak
nlinks:tag('li'):wikitext(v)
endelse
i = i + 1
box:tag('div'):addClass("noprint"):node(nlinks)
end
end
return frame:expandTemplate ({title='Infobox', args = infobox_args})
if title ~= nil then
end
box:tag('div'):cssText("font-weight: bold;"):wikitext(title )
if list ~= nil then
local links = mw.html.create('ul')
for i,v in pairs(list) do
links:tag('li'):wikitext(v)
end
box:tag('div'):addClass("noprint"):node(links)
end
end
return tostring(box)
end
 
function p.browseLinkssystem(frame)
local args = getArgs(frame)
return browseLinkssystem(args)
end
 
Line 374 ⟶ 364:
-- HIGHWAY SYSTEM HEADER
 
local function systemhighwaySystem(args)
if args.nobrowse then return nil end
local country = country(args)
Line 389 ⟶ 379:
end
 
function p.systemhighwaySystem(frame)
local args = getArgs(frame)
return systemhighwaySystem(args)
end