Module:Sports table: Difference between revisions

Content deleted Content added
use stack templates
new optional feature for New Caledonia national football team 1980–99 results (only works if supported by style)
Line 118:
team_list[Args['team'..N_teams]] = N_teams -- team X entry is position i
end
 
-- Optional totals
local total_row_name = 'SPORTS_TABLE_TOTAL'
if yesno(Args['show_totals'] or 'no') then
N_teams = N_teams+1
Args['team' .. N_teams] = total_row_name
Args['name_' .. total_row_name] = 'Total'
Args['result' .. N_teams] = total_row_name
Args['col_' .. total_row_name] = '#eee'
team_list[N_teams] = Args['team' .. N_teams]
team_list[Args['team'..N_teams]] = N_teams
end
 
-- Show position
local position_col = yesno(Args['show_positions'] or 'yes') and true or false
Line 245 ⟶ 257:
-- Bold this line or not
local ii_fw = ii == ii_show and 'font-weight: bold;' or 'font-weight: normal;'
if yesno(Args['show_totals'] or 'no') and team_code_ii == total_row_name then
ii_fw = 'font-weight: bold;'
end
-- Check whether there is a note or not, if so get text ready for it
Line 321 ⟶ 336:
-- Now build the rows
if yesno(Args['show_totals'] or 'no') and team_code_ii == total_row_name then
table.insert(t,'|- \n') -- New row
table.insert(t,'|- class="sortbottom"\n') -- New row
else
table.insert(t,'|- \n') -- New row
end
if position_col then
table.insert(t,'| style="text-align: center;'..ii_fw..bg_col..'"| '..pos_num..'\n') -- Position number