Module:Sports table/Badminton team: Difference between revisions

Content deleted Content added
update from sandbox (support for game_for_against_style and point_for_against_style in rows)
m Protected "Module:Sports table/Badminton team": High-risk template or module: 270 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))
 
(3 intermediate revisions by 2 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 142 ⟶ 143:
end
if not hide_for_against then
if do_ratioshow_matches then
tt = p_sub.colhead(tt,20,'<abbr title="'..fa_word_plur..' for">'..fa_letter..'F</abbr>') -- For col
tt = p_sub.colhead(tt,20,'<abbr title="'..fa_word_plur..' againstfor">'..fa_letter..'AF</abbr>') -- AgainstFor col
tt = p_sub.colhead(tt,20,'<abbr title="'..fa_word_plur..' foragainst">'..fa_letter..'FA</abbr>') -- ForAgainst col
if do_ratio then
if do_ratio then
tt = p_sub.colhead(tt,20,'<abbr title="'..fa_word_sing..' ratio">'..fa_letter..'R</abbr>') -- Ratio col
elseif do_percentage then
tt = p_sub.colhead(tt,20,'<abbr title="'..fa_word_sing..' percentage">%</abbr>') -- Percentage col
else
tt = p_sub.colhead(tt,20,'<abbr title="'..fa_word_sing..' difference">'..fa_letter..'D</abbr>') -- Difference col
end
end
if not hide_game_for_against then
tt = p_sub.colhead(tt,20,'<abbr title="'..gfa_word_plur..' for">'..gfa_letter..'F</abbr>') -- For col
tt = p_sub.colhead(tt,20,'<abbr title="'..gfa_word_plur..' against">'..gfa_letter..'A</abbr>') -- Against col
Line 233 ⟶ 236:
-- 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 369 ⟶ 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..'" |'..maigmfor..'\n') -- MAMF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..mcompmaig..'\n') -- Match comparisonMA
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..mformcomp..'\n') -- MFMatch comparison
end
if Args['game_for_against_style'] ~= 'none' then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gfor..'\n') -- GF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gaig..'\n') -- GA
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gcomp..'\n') -- Game comparison
end
if Args['point_for_against_style'] ~= 'none' then -- game param hides games and points in header
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..pfor..'\n') -- PF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..paig..'\n') -- PA
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..pcomp..'\n') -- Point comparison
end
end
end