Module:Sandbox/B2project/WLT: Difference between revisions

Content deleted Content added
Created page with '-- Style for football tables local pp = {} function pp.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt) -- Load relevant module...'
 
No edit summary
Line 16:
-- Custom header options
local group_head_text = Args['group_header'] or '<abbr title="Group">Grp</abbr>'
local OTwin_head_texttie_head_text = Args['OTwin_headertie_header'] or '<abbr title="Won in overtimeTie">OTWT</abbr>'
local OTloss_head_text = Args['OTloss_header'] or '<abbr title="Lost in overtime">OTL</abbr>'
-- Use points instead of goals for/against
local for_against_style = Args['for_against_style'] or 'goals'
Line 84 ⟶ 83:
-- Get custom/default options for in table
local win_points = tonumber(Args['winpoints']) or 32
local OTwin_pointstie_points = tonumber(Args['OTwinpointstiepoints']) or 21
local OTloss_points = tonumber(Args['OTlosspoints']) or 1
local loss_points = tonumber(Args['losspoints']) or 0
-- Get some input
local wins = tonumber(Args['win_'..team_code_ii]) or 0
local OTwinsties = tonumber(Args['OTwin_tie_'..team_code_ii]) or 0
local OTlosses = tonumber(Args['OTloss_'..team_code_ii]) or 0
local losses = tonumber(Args['loss_'..team_code_ii]) or 0
local gfor = tonumber(Args['gf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
Line 99 ⟶ 96:
local hth_local = Args['hth_'..team_code_ii] or nil
-- Then calculate some values
local matches = wins + OTwins + OTlossesties + losses
local points = win_points*wins + OTwin_pointstie_points*OTwins + OTloss_points*OTlossesties + loss_points*losses + s_pts
-- Comparison of for against
Line 136 ⟶ 133:
if full_table then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..wins..'\n') -- Won
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..OTwins..'\n') -- Won in OT
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..OTlosses..'\n') -- Lost in OT
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..losses..'\n') -- Lost
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..OTwinsties..'\n') -- Won in OTTie
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gfor..'\n') -- GF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gaig..'\n') -- GA