Module:Medals table and Module:Medals table/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
cast totals as numbers |
No edit summary |
||
Line 208: | Line 208: | ||
local isHost = args['host_' .. IOC] |
local isHost = args['host_' .. IOC] |
||
-- this is mainly for the parameter names example so you can override it. |
-- this is mainly for the parameter names example so you can override it. |
||
local total = |
local total = args['total_' .. IOC] or gold + silver + bronze |
||
local color = isHost and hostColor or defaultRowColor |
local color = isHost and hostColor or defaultRowColor |
||
Line 262: | Line 262: | ||
:attr('scope', 'row') |
:attr('scope', 'row') |
||
:css('background-color', color) |
:css('background-color', color) |
||
:css('color', ' |
:css('color', 'var(--color-base-fixed);') |
||
:css('text-align','left') |
:css('text-align','left') |
||
:wikitext(nation) |
:wikitext(nation) |
||
Line 315: | Line 315: | ||
:attr('colspan', colspan) |
:attr('colspan', colspan) |
||
:tag('th') |
:tag('th') |
||
:wikitext(lang:formatNum |
:wikitext(lang:formatNum(args['total_gold'] or totalGold)) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
:tag('th') |
:tag('th') |
||
:wikitext(lang:formatNum |
:wikitext(lang:formatNum(args['total_silver'] or totalSilver)) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
:tag('th') |
:tag('th') |
||
:wikitext(lang:formatNum |
:wikitext(lang:formatNum(args['total_bronze'] or totalBronze)) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
:tag('th') |
:tag('th') |
||
:wikitext(lang:formatNum |
:wikitext(lang:formatNum(args['grand_total'] or totalGold + totalSilver + totalBronze)) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
end |
end |