Module:Sports table: Difference between revisions

Content deleted Content added
Forgot to copy line
Add group listing functionality
Line 77:
else
full_table = true
end
-- Show groups or note
local show_groups_val = Args['show_groups'] or 'no'
local group_col
-- True if par doesn't exist, false otherwise
-- First convert to lower case if it is a string
show_groups_val = string.lower(show_groups_val)
if show_groups_val=='y' or show_groups_val=='yes' or show_groups_val=='t' or show_groups_val=='true' or show_groups_val=='1' then
group_col = true
else
group_col = false
end
Line 106 ⟶ 118:
 
-- Write column headers
t_return = p_style.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt,p_matches,match_table,N_teams,team_list)
if match_table then
-- Add empty column header
Line 167 ⟶ 179:
-- Write rows
local team_name, team_code_ii, team_code_jj, pos_num, group_txt, note_local
local note_string, note_local, note_local_num, note_id
local note_id_list = {}
Line 176 ⟶ 188:
-- Now read values
pos_num = Args['pos_'..team_code_ii] or ii
group_txt = Args['group_'..team_code_ii] or ' '
team_name = Args['name_'..team_code_ii] or team_code_ii
note_local = Args['note_'..team_code_ii] or nil
Line 263 ⟶ 276:
table.insert(t,'|- \n') -- New row
table.insert(t,'! scope="row" style="text-align: center;'..ii_fw..bg_col..'"| '..pos_num..'\n') -- Position number
if full_table and group_col then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..group_txt..'\n') -- Group number/name
end
table.insert(t,'| style="text-align: left; white-space:nowrap;'..ii_fw..bg_col..'"| '..team_name..note_string..status_string..'\n')-- Team (with possible note)
-- Call to subfunction