Module:GR header explained

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

function p.main(frame) local args = getArgs(frame,) local sign = local line = local mode =

local name =

-- Box style if args.mode

'AA' then sign = '0057A3;color:#FFF;text-align:left' else sign = 'FFF' end

-- Line style if args.line ~= nil then line = 'border-top:'..p.line(args.line,args.name) end if args.line_2 ~= nil then line = line..';border-bottom:'..p.line(args.line_2,args.name) end

-- Mode style if args.mode

'AA' then mode = elseif p.mode(args.mode) ~= then mode = end

mw.log(p.mode(args.mode)) -- English name style if name[2]

'KAT' then name[2] = elseif name[2]

'Athens International Airport' then name[2] = '

'..name[2]..'' else name[2] = '
'..name[2]..'' end

return '

'..mode[1]..'

'..frame:expandTemplate..name[2]..'

'..mode[2]..'

'end

function p.line(s,n) if s

'AM1' then c = '007A33' elseif s

'AM2' then c = 'DA291C' elseif s

'AM3' or s

'TS' then c = '10069F' elseif s

'AM4' then c = 'FFA300' elseif s

'AS' then if n

'Athina' then c = '00A3E0' else c = 'FFCD00' end elseif s

'ASK' then c = '00A3E0' elseif s

'AT' then c = '78BE20' else return 'none' end return '6px solid #'..cend

function p.mode(s,f) if s

nil and f

'r' then return '

' elseif s

'S' then m = elseif s

'SO' then m = elseif s

'AA' then m = elseif s

'AM' then m = elseif s

'AS' then m = elseif s

'AT' then m = elseif s

'PS' then m = elseif s

'TS' then m = else return end return '

'end

return p