Content deleted Content added
MusikBot II (talk | contribs) m Protected "Module:Sports table/CricketRR": High-risk template or module (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite)) |
SocietyBox (talk | contribs) m show_header_pts arg |
||
Line 2:
local pp = { }
local function args_points(Args)
local pts = {}
pts.bonus = tonumber(Args['bonuspoints']) or 1
return pts
end
local function abbr_header(txt, abbr, show_header_pts, pts)
if show_header_pts then
txt = txt .. ' – ' .. pts .. (pts == 1 and ' point' or ' points')
end
return '<abbr title="' .. txt .. '">' .. abbr .. '</abbr>'
end
function pp.header(t, Args, p_sub, pos_label, group_col, VTE_text, full_table, results_header_txt)
Line 21 ⟶ 42:
--Header specific options
local pts = args_points(Args)
local group_head_text = Args['group_header'] or '<abbr title="Group">Grp</abbr>'
local team_head_text = Args['team_header'] or 'Team'
local tie_head_text = Args['tie_header'] or abbr_header('
local nr_head_text = Args['nr_header'] or abbr_header('
local bonus_head_text = Args['bonus_header'] or '<abbr title="Bonus points">BP</abbr>'
local deduct_head_text = Args['deduct_header'] or '<abbr title="Deductions">Ded</abbr>'
Line 36 ⟶ 60:
local show_nrr = yesno(Args['show_nrr'] or 'yes')
local show_nrr_fa = yesno(Args['show_nrr_fa'] or 'no') and show_nrr
▲ --local ranking_style = Args['ranking_style'] or 'pts'
-- Initialize
Line 62 ⟶ 83:
if full_table then
tt = p_sub.colhead(tt,28,abbr_header('
local loss_head_text = abbr_header('Lost', 'L', show_pts, pts.loss)
if loss_first then
tt = p_sub.colhead(tt,28,
if show_tie then
Line 75 ⟶ 97:
end
tt = p_sub.colhead(tt, 28,
end
if show_nr then
Line 121 ⟶ 143:
local mm = require('Module:Math')
local yesno = require('Module:Yesno')
▲ -- Do not change these defaults without first checking which tables use them
▲ local win_points = tonumber(Args['winpoints']) or 2
▲ local tie_points = tonumber(Args['tiepoints']) or 1
▲ local nr_points = tonumber(Args['nrpoints']) or 1
▲ local loss_points = tonumber(Args['losspoints']) or 0
-- table options, to match those in the header
Line 159 ⟶ 173:
local matches = wins + losses + ties + noresults
local
local s_bps = pts.bonus*bonuses
local points =
-- Some local vars
|