Content deleted Content added
←Created page with '-- Style for cricket tables local pp = { } function pp.header(t, Args, p_sub, pos_label, group_col, VTE_text, full_table, results_header_txt) -- Load relevant modules local yesno = require('Module:Yesno') -- Create table header -- Pre stuff local team_width = Args['teamwidth'] or '180' local sort_text = yesno(Args['sortable_table'] or 'no') and ' sortable' or '' --local show_played = not yesno(Args['hide_played'] or 'no') table.ins...' Tags: Mobile edit Mobile web edit Advanced mobile edit |
m Grammar! |
||
(4 intermediate revisions by one other user not shown) | |||
Line 26:
local draw_head_text = Args['draw_header'] or '<abbr title="Drawn">D</abbr>'
local nr_head_text = Args['nr_header'] or '<abbr title="No result">NR</abbr>'
local bonus_head_text = Args['bonus_header'] or '<abbr title="Bonus Points">BP</abbr>'
local quot_head_text = Args['quot_header'] or '<abbr title="Runs Per Wicket Ratio">[[Runs Per Wicket Ratio|Quot]]</abbr>'
--
local loss_first = yesno(Args['loss_before_tie'] or 'yes')
local show_nr = yesno(Args['show_nr'] or 'yes')
local show_bonus = yesno(Args['show_bonus'] or 'yes')
local show_quot = yesno(Args['show_quot'] or 'yes')
Line 66 ⟶ 68:
tt = p_sub.colhead(tt,32,nr_head_text) --No result col
end
if show_bonus then
end▼
tt = p_sub.colhead(tt,32,bonus_head_text)
--Bonus Points col
▲ end
end
tt = p_sub.colhead(tt, 32, '<abbr title="Points">Pts</abbr>') -- Points col
Line 94 ⟶ 100:
local draw_points = tonumber(Args['drawpoints']) or 5
local nr_points = tonumber(Args['nrpoints']) or 5
local bonus_points = tonumber(Args['bonuspoints']) or 5
local loss_points = tonumber(Args['losspoints']) or 0
Line 101 ⟶ 108:
local show_tie = yesno(Args['show_tie'] or 'yes')
local show_nr = yesno(Args['show_nr'] or 'yes')
local show_bonus = yesno(Args['show_bonus'] or 'yes')
local show_quot = yesno(Args['show_quot'] or 'yes')
-- Get some input
Line 108 ⟶ 116:
local losses = tonumber(Args['loss_'..team_code_ii]) or 0
local noresults = tonumber(Args['nr_'..team_code_ii]) or 0
local bonuspoints = tonumber(Args['bonus_'..team_code_ii]) or 0
local quot = tonumber(Args['quot_'..team_code_ii]) or 0
Line 113 ⟶ 122:
-- Then calculate some values
local matches = wins + losses + draws + ties + noresults
local points = win_points*wins + loss_points*losses + tie_points*ties + draw_points*draws + nr_points*noresults + bonuspoints
-- Some local vars
Line 183 ⟶ 192:
if show_nr then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'.. noresults..'\n') -- Noresults
end
if show_bonus then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'.. bonuspoints..'\n')
-- Bonus Points
end
end
Line 208 ⟶ 221:
status_code = { A='Advances to a further round', C='Champion', D='Disqualified',
E='Eliminated', G='Guest', H='Host', O='Play-off winner', P='Promoted', Q='Qualified
R='Relegated', T='Qualified, but not yet
local status_letters = (Args['status_order'] or '') .. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|