Module:Sports table: Difference between revisions

Content deleted Content added
Replace with sandbox version for random start
Use yesno module for options instead of manual list (copy from sandbox)
Line 23:
local N_teams = top_pos - 1 -- Default to 0 at start, but higher number needed to skip certain entries
-- Load modules
local yesno = require('Module:Yesno')
-- Load style and (sub) modules
local style_def = Args['style'] or 'WDL'
Line 80 ⟶ 82:
-- First convert to lower case if it is a string
pld_pts_val = string.lower(pld_pts_val)
if yesno(pld_pts_val) then
if pld_pts_val=='y' or pld_pts_val=='yes' or pld_pts_val=='t' or pld_pts_val=='true' or pld_pts_val=='1' then
full_table = false
elseif pld_pts_val=='no_hide_class_rules' then
Line 91 ⟶ 93:
-- Show groups or note
local show_groups_val = Args['show_groups'] or 'no'
local group_col = false
if yesno(show_groups_val) then group_col = true end
-- True if par doesn't exist, false otherwise
-- First convert to lower case if it is a string
show_groups_val = string.lower(show_groups_val)
if show_groups_val=='y' or show_groups_val=='yes' or show_groups_val=='t' or show_groups_val=='true' or show_groups_val=='1' then
group_col = true
else
group_col = false
end
-- Show match_table or not
local show_matches_val = Args['show_matches'] or 'no'
local match_table = false
if yesno(show_matches_val) then match_table = true end
-- True if par doesn't exist, false otherwise
-- First convert to lower case if it is a string
show_matches_val = string.lower(show_matches_val)
if show_matches_val=='y' or show_matches_val=='yes' or show_matches_val=='t' or show_matches_val=='true' or show_matches_val=='1' then
match_table = true
else
match_table = false
end
-- Custom position column label or note