Content deleted Content added
Allowing future row color |
Rewriting gathering of arguments |
||
Line 4:
}
function p.rowcolor(frame)
local pframe = frame:getParent()
▲ --This function determines if this is a future route, present route, or decommissioned route, and colors the row appropriately.
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
--Import parameters from template
local established =
local decommissioned =
if p.lang:formatDate('Y-m-d') < established then --this is a future route
return "|- style=\"background-color:#ffdead;\" title=\"Future route\"\n"
elseif decommissioned ~= '
return '|- style=\"background-color:#d3d3d3;\" title=\"Former route\"\n'
else --this is a normal route
Line 20 ⟶ 23:
end
function p.termini(frame)
local pframe = frame:getParent()
▲ --This function determines if this is a beltway or not, and displays the termini columns appropriately.
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
--Import parameters from template
local beltway =
local terminus_a =
local terminus_b =
--The template passes this function
if beltway ~= '
return "|colspan=2 align=center|" .. beltway
else
|