Content deleted Content added
No edit summary |
MusikBot II (talk | contribs) m Protected "Module:Sports table/Badminton team": High-risk template or module: 270 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite)) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 36:
local for_against_style = Args['for_against_style'] or 'matches'
local fa_letter, fa_word_sing, fa_word_plur
local show_matches = yesno(Args['show_matches'] or 'yes')
local hide_for_against = false
-- First convert to lower case if it is a string
Line 127 ⟶ 128:
tt.tab_text = t -- Actual text
-- Actual headers
tt = p_sub.colhead(tt,
-- Add group header
if full_table and group_col then
tt = p_sub.colhead(tt,
end
tt = p_sub.colhead(tt,team_width,team_head_text..VTE_text) -- Team col
tt = p_sub.colhead(tt,
if full_table then
tt = p_sub.colhead(tt,
if loss_first then
tt = p_sub.colhead(tt,
else
tt = p_sub.colhead(tt,
end
if not hide_for_against then
tt = p_sub.colhead(tt,18,'<abbr title="'..fa_word_plur..' for">'..fa_letter..'F</abbr>') -- For col▼
tt = p_sub.colhead(tt,
▲ tt = p_sub.colhead(tt,
▲ if do_ratio then
if do_ratio then
tt = p_sub.colhead(tt,
elseif do_percentage then
tt = p_sub.colhead(tt,
else
tt = p_sub.colhead(tt,
end
end
tt = p_sub.colhead(tt,
tt = p_sub.colhead(tt,
if do_ratio then
tt = p_sub.colhead(tt,
elseif do_percentage then
tt = p_sub.colhead(tt,
else
tt = p_sub.colhead(tt,
end
if not hide_point_for_against then
tt = p_sub.colhead(tt,
tt = p_sub.colhead(tt,
if do_ratio then
tt = p_sub.colhead(tt,
elseif do_percentage then
tt = p_sub.colhead(tt,
else
tt = p_sub.colhead(tt,
end
end
Line 177 ⟶ 180:
end
if show_points then
tt = p_sub.colhead(tt,
elseif show_perc then
tt = p_sub.colhead(tt,36,'<abbr title="Win percentage">PCT</abbr>') -- Win percentage col
Line 208 ⟶ 211:
local mfor = tonumber(Args['mf_'..team_code_ii]) or tonumber(Args['mf_'..team_code_ii]) or 0
local maig = tonumber(Args['ma_'..team_code_ii]) or tonumber(Args['ma_'..team_code_ii]) or 0
local gfor = tonumber(Args['
local gaig = tonumber(Args['
local pfor = tonumber(Args['pf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
local paig = tonumber(Args['pa_'..team_code_ii]) or tonumber(Args['pa_'..team_code_ii]) or 0
Line 218 ⟶ 221:
local points = win_points*wins + loss_points*losses + s_pts
local win_perc = ''
--Some sports use draw as well▼
if matches == 0 then
-- Escape for zero matches
win_perc = '—'
else
elseif losses > 0 then▼
-- Drop the leading zero (from the string)▼
win_perc =
▲ -- Drop the leading zero (from the string)
win_perc = string.sub(win_perc,2,string.len(win_perc))
end
end
-- Show for/against
local for_against_style = Args['for_against_style'] or 'goals'
local show_matches = yesno(Args['show_matches'] or 'yes')
local hide_for_against = false
for_against_style = string.lower(for_against_style)
Line 291 ⟶ 298:
-- Formatting with signs
if gcomp>0 then
gcomp='+'..
elseif gcomp < 0 then
gcomp='−'..-gcomp
Line 366 ⟶ 373:
if not hide_for_against then
if show_matches then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..mfor..'\n') -- MF▼
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..
end
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gaig..'\n') -- GA▼
if Args['game_for_against_style'] ~= 'none' then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gcomp..'\n') -- Game comparison▼
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..
if Args['point_for_against_style'] ~= 'none' then -- game param hides games and points in header
end
end
end
|