Module:Sports table/WL OTL tiebreak: Difference between revisions

Content deleted Content added
Allow change in pld header
Use yesno module for options instead of manual list
Line 3:
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
Line 8 ⟶ 11:
local sort_text = ''
local sort_table_val = Args['sortable_table'] or 'no'
sort_table_valif = string.loweryesno(sort_table_val) then sort_text = 'sortable' end
if sort_table_val=='y' or sort_table_val=='yes' or sort_table_val=='t' or sort_table_val=='true' or sort_table_val=='1' then
sort_text = 'sortable'
end
table.insert(t,'{|class="wikitable '..sort_text..'" style="text-align:center;"\n') -- Open table
Line 47:
local do_ratio = false
-- True if exist, false otherwise
if yesno(use_ratio_val) then do_ratio = true end
-- First convert to lower case if it is a string
use_ratio_val = string.lower(use_ratio_val)
if use_ratio_val=='y' or use_ratio_val=='yes' or use_ratio_val=='t' or use_ratio_val=='true' or use_ratio_val=='1' then
do_ratio = true
end
-- Initialize
Line 92 ⟶ 88:
-- Sub-module usage
local mm = require('Module:Math')
local yesno = require('Module:Yesno')
-- Get custom/default options for in table
Line 116 ⟶ 113:
local use_ratio_val = Args['use_goal_ratio'] or 'no'
local skip_sign
if yesno(use_ratio_val) then
-- First convert to lower case if it is a string
use_ratio_val = string.lower(use_ratio_val)
if use_ratio_val=='y' or use_ratio_val=='yes' or use_ratio_val=='t' or use_ratio_val=='true' or use_ratio_val=='1' then
-- Now it is the goal ratio/goal average
if gaig == 0 then