Module:Sports table/Chess: Difference between revisions

Content deleted Content added
texting if I fixed it for mobile
added argument sb_before_w
 
(2 intermediate revisions by 2 users not shown)
Line 80:
pp.preprocess(Args,tb_numplayers,'tb',yesno(Args['crosstable_fractions'] or 'no'))
end
local score_width = Args['score_width'] or 28
-- Which columns to show
local show_rating = yesno(Args['show_rating'] or 'no')
Line 89 ⟶ 88:
local show_draw = yesno(Args['show_draw'] or 'no')
local show_loss = yesno(Args['show_loss'] or 'no')
local sb_first = yesno(Args['sb_before_w'] or 'no')
local show_sb = yesno(Args['show_sb'] or 'no')
local extra_cols = tonumber(Args['extra_cols']) or 0
Line 115:
tt = p_sub.colhead(tt,28, '<abbr title="Games Played">Pld</abbr>') -- Games played col
end
tt = p_sub.colhead(tt, 28, 'Score') -- Score col
if full_table then
if show_hth and hth_first then
tt = p_sub.colhead(tt,28, '<abbr title="Head-to-head">H2H</abbr>') -- Head-to-head col
end
if show_sb and sb_first then
tt = p_sub.colhead(tt,28, '<abbr title="Sonneborn–Berger score">[[Sonneborn–Berger score|SB]]</abbr>')
end
if show_win then
Line 132 ⟶ 135:
tt = p_sub.colhead(tt,28, '<abbr title="Head-to-head">H2H</abbr>') -- Head-to-head col if not first tiebreak
end
if show_sb and not sb_first then
tt = p_sub.colhead(tt,28, '<abbr title="Sonneborn–Berger score">[[Sonneborn-BergerSonneborn–Berger score|SB]]</abbr>')
end
for ecol=1,extra_cols do
Line 172 ⟶ 175:
local show_loss = yesno(Args['show_loss'] or 'no')
local wdl_iff_hth = yesno(Args['wdl_iff_hth'] or 'no')
local sb_first = yesno(Args['sb_before_w'] or 'no')
local show_sb = yesno(Args['show_sb'] or 'no')
local nosb = yesno(Args['nosb_'..team_code_ii] or 'no')
Line 211 ⟶ 215:
end
 
-- Sonneborn-BergerSonneborn–Berger score
if show_sb then
if (sb_iff_hth and hth_local == '&mdash;') or nosb then
Line 258 ⟶ 262:
if show_hth and hth_first then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..(hth_local or '')..'\n') -- Head-to-head
end
if show_sb and sb_first then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..sb_score..'\n') -- Sonneborn–Berger
end
if show_win then
Line 280 ⟶ 287:
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..(hth_local or '')..'\n') -- Head-to-head if not first tiebreak
end
if show_sb and not sb_first then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..sb_score..'\n') -- Sonneborn-BergerSonneborn–Berger
end
for ecol=1,extra_cols do