Module:Sports table/WDL: Difference between revisions

Content deleted Content added
No edit summary
add more optional control for tables with only played and points (but also need point notes)
Line 50:
local show_away_goals = yesno(Args['show_away_goals'] or 'no')
local show_bonus_points = yesno(Args['show_bonus_points'] or 'no')
local show_win = yesno(Args['show_win'] or 'yes')
local show_draw = yesno(Args['show_draw'] or 'yes')
local show_loss = yesno(Args['show_loss'] or 'yes')
-- Use points instead of goals for/against
local for_against_style = Args['for_against_style'] or 'goals'
Line 133 ⟶ 135:
end
if full_table then
if show_win then
tt = p_sub.colhead(tt,28,'<abbr title="Won">W</abbr>') -- Win col
end
if loss_first then
if show_loss then
tt = p_sub.colhead(tt,28,'<abbr title="Lost">L</abbr>') -- Loss col
end
if show_draw then
tt = p_sub.colhead(tt,28,draw_head_text) -- Draw col
Line 143 ⟶ 149:
tt = p_sub.colhead(tt,28,draw_head_text) -- Draw col
end
if show_loss then
tt = p_sub.colhead(tt,28,'<abbr title="Lost">L</abbr>') -- Loss col
end
end
if rounds_won then
Line 200 ⟶ 208:
-- Get custom/default options for in table
local show_win = yesno(Args['show_win'] or 'yes')
local show_draw = yesno(Args['show_draw'] or 'yes')
local show_loss = yesno(Args['show_loss'] or 'yes')
local win_points = tonumber(Args['winpoints']) or (show_draw and 3 or 2)
local draw_points = tonumber(Args['drawpoints']) or (show_draw and 1 or 0)
Line 400 ⟶ 410:
losses = numorval(Args['loss_'..team_code_ii])
end
if show_win then
table.insert(t,'| style="'..win_fw..bg_col..'" |'..wins..win_string..'\n') -- Won
end
if loss_first then
if show_loss then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..losses..'\n') -- Lost
end
if show_draw then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..draws..'\n') -- Drawn
Line 412 ⟶ 425:
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..draws..'\n') -- Drawn
end
if show_loss then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..losses..'\n') -- Lost
end
end
if rounds_won then