-- Style for football 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 '165' local sort_text = local sort_table_val = Args['sortable_table'] or 'no' if yesno(sort_table_val) then sort_text = 'sortable' end table.insert(t,'
'..matches..'\n') -- Played if full_table then table.insert(t,' | '..wins..win_string..'\n') -- Won if loss_first then table.insert(t,' | '..losses..'\n') -- Lost else table.insert(t,' | '..losses..'\n') -- Lost end if not hide_for_against then table.insert(t,' | '..mfor..'\n') -- MF table.insert(t,' | '..maig..'\n') -- MA table.insert(t,' | '..mcomp..'\n') -- Match comparison if Args['game_for_against_style'] ~= 'none' then table.insert(t,' | '..gfor..'\n') -- GF table.insert(t,' | '..gaig..'\n') -- GA table.insert(t,' | '..gcomp..'\n') -- Game comparison end if Args['point_for_against_style'] ~= 'none' then table.insert(t,' | '..pfor..'\n') -- PF table.insert(t,' | '..paig..'\n') -- PA table.insert(t,' | '..pcomp..'\n') -- Point comparison end end end if rank_points then -- Add - for negative point totals if points<0 then table.insert(t,' | -'..-points..hth_string..'\n') else table.insert(t,' | '..points..hth_string..'\n') end elseif rank_perc then table.insert(t,' | '..win_perc..hth_string..'\n') 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 = status_called = local status_letters = 'ACDEGHOPQRTXYZ' -- Status position (before or after read and default) local stat_pos_val = Args['status_pos'] or local status_position = 'after' -- Default location stat_pos_val = string.lower(stat_pos_val) if stat_pos_val'before' then status_position = 'before' elseif stat_pos_val'after' then status_position = 'after' end -- Read in custom status options if Args['status_text_X'] then status_code.X = Args['status_text_X'] end if Args['status_text_Y'] then status_code.Y = Args['status_text_Y'] end if Args['status_text_Z'] then status_code.Z = Args['status_text_Z'] end return end return pp |
---|