-- Style for curling tableslocal 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 '170' local skip_width = Args['skipwidth'] or '140' local wlt_width = Args['wltwidth'] or '28' local sort_text = yesno(Args['sortable_table'] or 'no') and 'sortable' or local show_played = not yesno(Args['hide_played'] or 'no') local show_ends = yesno(Args['show_ends'] or 'yes') and true or false local show_pct = yesno(Args['show_pct'] or 'yes') and true or false local show_dsc = yesno(Args['show_dsc'] or 'no') and true or false local show_wlt = yesno(Args['show_wlt'] or 'no') and true or false local show_skip = not yesno(Args['hide_skip'] or 'no') -- Custom header local group_head_text = Args['group_header'] or 'Grp' local skip_head_text = Args['skip_header'] or 'Skip' -- Custom refs local pct_ref = Args['pct_ref'] or local dsc_ref = Args['dsc_ref'] or table.insert(t,'
'..skip_name..'\n') -- Skip end if show_played then table.insert(t,' | '..matches..'\n') -- Played end if full_table then table.insert(t,' | '..wins..win_string..'\n') -- Won table.insert(t,' | '..losses..'\n') -- Lost if show_wlt then table.insert(t,' | '..wlt..'\n') -- WLT end table.insert(t,' | '..pf..'\n') -- PF table.insert(t,' | '..pa..'\n') -- PA if show_ends then table.insert(t,' | '..ew..'\n') -- EW table.insert(t,' | '..el..'\n') -- EL table.insert(t,' | '..be..'\n') -- BE table.insert(t,' | '..se..'\n') -- SE end if show_pct then table.insert(t,' | '..pct..'%\n') -- Shot percentage end if show_dsc then table.insert(t,' | '..dsc..'\n') -- DSC end end return end function pp.status(Args) -- Declare status options -- ------------------------------------------------------------ -- NOTE: If you add to status_code, also add to status_called and status_letters | -- Or functionality will be compromised -- ------------------------------------------------------------ local status_code, status_called =, status_code = local status_letters = (Args['status_order'] or ) .. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -- Status position (before or after read and default) local stat_pos_val = string.lower(Args['status_pos'] or ) local status_position = 'after' -- Default location if stat_pos_val'before' then status_position = 'before' elseif stat_pos_val'after' then status_position = 'after' end -- Read in custom status options for l in mw.text.gsplit(status_letters, ) do status_called[l] = false status_code[l] = status_code[l] or '?' status_letters = mw.ustring.gsub(status_letters, '(' .. l ..'.-)' .. l, '%1') if Args['status_text_' .. l] then status_code[l] = Args['status_text_' .. l] end end return end return pp |
---|