Module:Sandbox/CAS222222221: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 4:
local p = {}
 
local function won (frame, args, i)
local cont = args['won' .. i] or 0
return frame:expandTemplate{ title = 'won', args = { cont } }
Line 16:
local function core(frame, args, i)
if args['award' .. i] == nil then return end
local ret
 
Line 30 ⟶ 29:
function p.main(frame)
local args = getArgs(frame)
args.frame = frame
return p._main(args)
end
Line 35:
function p._main(args)
-- Main module code goes here.
local frame = args.frame
local ret, temp = '', ''
local winTotal, nomTotal = 0, 0
Line 41:
ret =
'{| class="infobox" style="width: 20em; text-align: left; font-size: 90%; vertical-align: middle;"\n' ..
'|+ style="font-size: 9pt; font-weight: bold;" | List of accolades received by <i>' .. (args[.title] orand '<span class="error">Thereceived parameterby' <code>title</code>.. isargs needed</span>or '') .. '</i>\n'
if args.image then
Line 68:
end
if args.totals ~= 'no' then
local win = args.totalwin or winTotal
ret = ret ..
local nom = args.totalnom or nomTotal
'|-style="background:#d9e8ff;"\n' ..
if win == 0 and nom == 0 then
'| style="text-align:center;" colspan="3"| <b>Total number of awards and nominations</b>\n' ..
else
'|-\n' ..
ret = ret ..
'|' .. frame:expandTemplate{ title = 'won', args = { '<b>Totals</b>' } } .. '\n' ..
'|-\n' ..
'|' .. frame:expandTemplate{ title = 'won', args = { '<b>' .. (args.totalwin or winTotal) .. '</b>' } } .. '\n' ..
'|-style="background:#d9e8ff;"\n' ..
'|' .. frame:expandTemplate{ title = 'nom', args = { '<b>' .. (args.totalnom or totalnom) .. '</b>' } } .. '\n'
'| style="text-align:center;" colspan="3"| <b>Total number of awards and nominations</b>\n' ..
'|-\n' ..
'|' .. frame:expandTemplate{ title = 'won', args = { '<b>Totals</b>' } } .. '\n' ..
'|' .. frame:expandTemplate{ title = 'won', args = { '<b>' .. (args.totalwin or winTotal)win .. '</b>' } } .. '\n' ..
'|' .. frame:expandTemplate{ title = 'nom', args = { '<b>' .. (args.totalnom or totalnom)nom .. '</b>' } } .. '\n'
end
end
if args.refsect ~= 'no' then
ret = ret ..
'|- style="background:#d9e8ff;"\n' ..