Module:Medals table and Module:Medals table/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
cast totals as numbers |
PitConclave (talk | contribs) m Testing dark mode |
||
Line 50: | Line 50: | ||
local limitReached = false |
local limitReached = false |
||
local showLimit = tonumber(args['show_limit']) |
local showLimit = tonumber(args['show_limit']) |
||
local lang = mw.getContentLanguage() |
|||
local function getFlag(code) |
local function getFlag(code) |
||
Line 99: | Line 98: | ||
footer = footer .. host .. leading |
footer = footer .. host .. leading |
||
end |
end |
||
local sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css" } } |
|||
root = root |
root = root |
||
Line 106: | Line 103: | ||
:addClass('wikitable') |
:addClass('wikitable') |
||
:addClass('sortable') |
:addClass('sortable') |
||
:addClass('sticky-header-multi') |
|||
:addClass('plainrowheaders') |
:addClass('plainrowheaders') |
||
:addClass('jquery-tablesorter') |
:addClass('jquery-tablesorter') |
||
Line 208: | Line 204: | ||
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 266: | Line 262: | ||
:wikitext(nation) |
:wikitext(nation) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(gold) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(silver) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(bronze) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(total) |
||
end |
end |
||
remainingEnd = rank |
remainingEnd = rank |
||
Line 286: | Line 282: | ||
:wikitext(args['remaining_link'] or args['remaining_text'] or 'Remaining') |
:wikitext(args['remaining_link'] or args['remaining_text'] or 'Remaining') |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(remainingGold) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(remainingSilver) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(remainingBronze) |
||
:tag('td') |
:tag('td') |
||
:wikitext |
:wikitext(remainingGold+remainingSilver+remainingBronze) |
||
end |
end |
||
Line 315: | Line 311: | ||
:attr('colspan', colspan) |
:attr('colspan', colspan) |
||
:tag('th') |
:tag('th') |
||
:wikitext |
:wikitext(args['total_gold'] or totalGold) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
:tag('th') |
:tag('th') |
||
:wikitext |
:wikitext(args['total_silver'] or totalSilver) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
:tag('th') |
:tag('th') |
||
:wikitext |
:wikitext(args['total_bronze'] or totalBronze) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
:tag('th') |
:tag('th') |
||
:wikitext |
:wikitext(args['grand_total'] or totalGold+totalSilver+totalBronze) |
||
:css('font-weight', 'bold') |
:css('font-weight', 'bold') |
||
end |
end |
||
Line 347: | Line 343: | ||
end |
end |
||
return header |
return header .. tostring(root) .. footer |
||
end |
end |
||