Content deleted Content added
BrandonXLF (talk | contribs) No edit summary Tag: Reverted |
BrandonXLF (talk | contribs) No edit summary Tag: Reverted |
||
Line 8:
local parser = parserModule.parser
local types = {
local function showRoute(route, routeType, routeLoc)▼
TCH = '[[File:TCH-blank.svg|15px]] [[Trans-Canada Highway]]',
Yellowhead = '[[File:Yellowhead Blank.svg|15px]] [[Yellowhead Highway]]',
['2'] = 'Interprovincial Highway 2'
}
▲local function showRoute(route, routeType, routeLoc, currProvince)
local out = ''
local parserArgs = {
province = routeLoc
}
local shield = parser(parserArgs, 'shieldmain') or parser(parserArgs, 'shield') or ''
local label = parser(parserArgs, 'name') or parser(parserArgs, 'abbr') or ''
local link = parser(parserArgs, 'link')
local alt = label .. ' marker'
if type(shield) == 'table' then
res[i] = string.format('[[File:%s|15px|alt=%s]]', v, alt)▼
end▼
else▼
out = out .. string.format('[[File:%s|15px|alt=%s]]', shield, alt)▼
end
▲ out = out .. (routeLoc ~= currProvince and (' ' .. routeLoc) or '') .. label
if not link or link == '' then
out = out .. ' ' .. label
▲ else
return out
Line 43 ⟶ 51:
repeat
local route = args[prefix .. index] or (index == 1 and args[prefix] or
local routeType = args[prefix .. '_type' .. index] or (index == 1 and args[prefix .. '_type'] or
local routeLoc = args[prefix .. '_province' .. index] or (index == 1 and args[prefix .. '_province'] or
if index ~= 1 then
Line 51 ⟶ 59:
end
out = out .. showRoute(route, routeType, routeLoc, currProvince)
index = index + 1
Line 62 ⟶ 70:
local args = getArgs(frame)
local type = args.type
local route = args.curr
local routeType = args.curr_type
local routeLoc = args.curr_province
return string.format(
return edgeColumn('prev', routeLoc, args)▼
frame:preprocess([[
.. showRoute(route, routeType, routeLoc)▼
{{s-start}}
.. edgeColumn('next', routeLoc, args)▼
|-
! colspan=3 | %s
|- style="text-align: center;"
| style="width:30%%;" | Previous route<br>%s
| style="width:40%%;" | %s
| style="width:30%%;" | Next route<br>%s
{{s-end}}
]]),
types[type] or args.title or error('Type or title missing'),
)
end
return p
|