Module:Sports table: Difference between revisions

Content deleted Content added
Limited inputs truncate table
Add fixture list functionality
Line 17:
local t_return = {}
local team_list = {}
local jj, jjj
-- Load style and (sub) modules
local style_def = Args['style'] or 'football'
local p_style = require('Module:Sports table/'..style_def)
local p_sub = require('Module:Sports table/sub')
local p_matches = require('Module:Sports results')
-- Random value used for uniqueness
Line 77 ⟶ 78:
full_table = true
end
-- Show match_table or not
local show_matches_val = Args['show_matches'] or 'no'
local match_table
-- True if par doesn't exist, false otherwise
-- First convert to lower case if it is a string
show_matches_val = string.lower(show_matches_val)
if show_matches_val=='y' or show_matches_val=='yes' or show_matches_val=='t' or show_matches_val=='true' or show_matches_val=='1' then
match_table = true
else
match_table = false
end
-- Custom position column label or note
local pos_label = Args['postitle'] or ''
Line 92 ⟶ 106:
 
-- Write column headers
t_return = p_style.header(t,Args,p_sub,pos_label,VTE_text,full_table,results_header_txt,p_matches,match_table,N_teams,team_list)
if match_table then
-- Add empty column header
t_return.count = t_return.count+1
table.insert(t_return.tab_text,'! scope="row" style="background-color:white;border-top:white;border-bottom:white;line-width:3pt;"| \n')
-- Add rest of header
t_return = p_matches.header(t_return,Args,p_sub,N_teams,team_list)
end
t = t_return.tab_text
local N_cols = t_return.count
Line 243 ⟶ 265:
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
t_return = p_style.row(frame,t,Args,p_sub,notes_exist,hth_id_list,full_table,rand_val,team_list,team_code_ii,ii_fw,bg_col,N_teams,ii,ii_show)
t = t_return.t
notes_exist = t_return.notes_exist
Line 309 ⟶ 331:
if results_defined then table.insert(t,text_field_result) end
end
end
-- Insert match row if needed
if match_table then
-- Add empty cell
table.insert(t,'| style="background-color:white;border-top:white;border-bottom:white;"| \n')
-- Add rest of match row
t = p_matches.row(t,Args,N_teams,team_list,ii,ii_show)
end