Modulo:Sports table: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m Mαρκος ha spostato la pagina Modulo:Sport table a Modulo:Sports table senza lasciare redirect: Come in en.wiki
Nessun oggetto della modifica
 
(50 versioni intermedie di 7 utenti non mostrate)
Riga 1:
require('strict')
-- Module to build tables for standings in Sports
-- See documentation for details
 
require('Module:No globals')
 
local p = {}
 
-- Helper functions
local function isnotblank(s)
return s and s:match( '^%s*(.-)%s*$' ) ~= ''
end
 
local function firstnonblank(s1,s2)
if ( s1 and s1:match( '^%s*(.-)%s*$' ) ~= '' ) then
return s1
elseif ( s2 and s2:match( '^%s*(.-)%s*$' ) ~= '' ) then
return s2
end
return nil
end
-- Main function
function p.main(frame)
-- Declare locals
local ArgsgetArgs = framerequire('Module:Arguments').argsgetArgs
local Args = getArgs(frame, {parentFirst = true})
local Pargs = frame:getParent().args
local ii_start, ii_end, N_rows_res = 0
local text_field_result
Riga 33 ⟶ 16:
local team_list = {}
local jj, jjj
 
-- Exit early if we are using section transclusion for a different section
if( isnotblank(PargsArgs['transcludesection']) and isnotblank(Args['section']) ) then
if(and PargsArgs['transcludesection'] ~= Args['section'] ) then
return ''
end
end
 
local templatestyles = frame:extensionTag{
-- Get the custom start point for the table (most will start by default at 1
name = 'templatestyles', args = { src = 'Module:Sports table/styles.css' }
}
 
-- Edit links if requested
local baselink = frame:getParent():getTitle()
if mw.title.getCurrentTitle().text == baselink then baselink = '' end
local template_name = Args['template_name']
or (baselink ~= '' and (':' .. baselink))
or ''
 
-- Get the custom start point for the table (most will start by default at 1)
local top_pos = tonumber(Args['highest_pos']) or 1
-- Get the custom end point for the table (unrestricted if bottom_pos is < top_pos)
local bottom_pos = tonumber(Args['lowest_pos']) or 0
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')
Riga 53 ⟶ 48:
local p_style = require('Module:Sports table/'..style_def)
local p_sub = require('Module:Sports table/sub')
 
-- ordinabile di default
Args['sortable_table'] = Args['sortable_table'] or 'sì'
 
-- Random value used for uniqueness
math.randomseed( os.clock() * 10^8 )
local rand_val = math.random()
 
-- Declare colour scheme
local result_col = {}
Riga 64 ⟶ 62:
yellow1='#FFFFBB', yellow2='#FFFFCC', yellow3='#FFFFDD', yellow4='#FFFFEE',
red1='#FFBBBB', red2='#FFCCCC', red3='#FFDDDD', red4='#FFEEEE',
black1='#BBBBBB', black2='#CCCCCC', black3='#DDDDDD', black4='#EEEEEE'},
gold='#F7F6A8', silver='#DCE5E5', bronze='#FFDAB9',
orange1='#FEDCBA', orange2='#FEEAD5',
white1='inherit',['']='inherit'
}
 
-- Show all stats in table or just matches played and points
local full_table = true
local hide_results = yesno(Args['hide_results'] or 'no')
local pld_pts_val = string.lower(Args['only_pld_pts'] or 'no')
local show_class_rules = yesno(Args['show_class_rules'] or 'yes') and true or false
-- True if par doesn't exist, false otherwise
if yesno(pld_pts_val) then
full_table = false
elseif pld_pts_val=='no_hide_class_rules' then
full_table = true
show_class_rules = false
end
 
-- Declare results column header
local results_header = {}
results_header = {Q='QualificationQualificazione', QR='QualificationQualificazione oro relegationretrocessione',
P='PromotionPromozione', PQR='PromotionPromozione, qualificationqualificazione oro relegationretrocessione',
PR='PromotionPromozione oro relegationretrocessione', PQ='PromotionPromozione oro qualificationqualificazione',
R='RelegationRetrocessione'}
local results_defined = false -- Check whether this would be needed
-- Possible prefix for result fields
local respre = (Args['result_prefix'] or '') .. '_'
respre = (respre == '_') and '' or respre
-- Now define line for column header (either option or custom)
local local_res_header = results_header[Args[respre..'res_col_header']] or Args[respre..'res_col_header'] or 'Risultato'
-- Check whether it includes a note
local res_head_note = Args['note_header_res']
local res_head_note_text = ''
if full_table and res_head_note then
notes_exist = true
res_head_note_text = frame:expandTemplate{ title = 'efn', args = { group='Table_notes', res_head_note} }
end
local results_header_txt = '! scope="col" class="unsortable" |'..local_res_header..res_head_note_text..'\n'
 
-- Get status option
local t_status = p_style.status(Args)
 
-- Alternative syntax for team list
if Args['team_order'] and Args['team_order'] ~= '' then
local team_order_offset = (tonumber(Args['team_order_start']) or 1) - 1
local tlist = mw.text.split(Args['team_order'], '%s*[;,]%s*')
for k, tname in ipairs(tlist) do
if tname ~= '' then
Args['team' .. (k + team_order_offset)] = tname
end
end
end
 
-- Read in number of consecutive teams (ignore entries after skipping a spot)
while Args['team'..N_teams+1] ~= nil and (bottom_pos < top_pos or N_teams < bottom_pos) do
N_teams = N_teams+1
-- Sneakily add it twice to the team_list parameter, once for the actual
Riga 96 ⟶ 125:
team_list[Args['team'..N_teams]] = N_teams -- team X entry is position i
end
 
-- Optional totals
-- Show all stats in table or just matches played and points
local total_row_name = 'SPORTS_TABLE_TOTAL'
local pld_pts_val = firstnonblank(Pargs['only_pld_pts'], Args['only_pld_pts']) or 'no'
if yesno(Args['show_totals'] or 'no') then
local full_table
N_teams = N_teams+1
local hide_class_rules = false
Args['team' .. N_teams] = total_row_name
-- True if par doesn't exist, false otherwise
Args['name_' .. total_row_name] = 'Totale'
-- First convert to lower case if it is a string
Args['result' .. N_teams] = total_row_name
pld_pts_val = string.lower(pld_pts_val)
Args['col_' .. total_row_name] = '#eee'
if yesno(pld_pts_val) then
team_list[N_teams] = Args['team' .. N_teams]
full_table = false
team_list[Args['team'..N_teams]] = N_teams
elseif pld_pts_val=='no_hide_class_rules' then
full_table = true
hide_class_rules = true
else
full_table = true
end
 
-- Show position
local position_col = yesno(Args['show_positions'] or 'yes') and true or false
 
-- Show groups or note
local show_groups_valgroup_col = firstnonblankyesno(PargsArgs['show_groups'], Args[or 'show_groupsno']) and true or 'no'false
 
local group_col = false
if yesno(show_groups_val) then group_col = true end
-- Show match_table or not
local show_matches_valmatch_table = firstnonblankyesno(PargsArgs['show_matches'], Args[or 'show_matchesno']) and true or 'no'false
local match_tablep_matches = falsematch_table and
(style_def == 'Chess' and require('Module:Sports results/'..style_def) or require('Module:Sports results'))
if yesno(show_matches_val) then match_table = true end
 
local p_matches = match_table and require('Module:Sports results')
-- Custom position column label or note
local pos_label = Args['postitle'] or '<abbr title="Posizione">Pos</abbr>'
if pos_labelposition_col == ''false then pos_label = nil end
 
-- If empty (or undeclared) then default
-- Show status or not
pos_label = '<abbr title="Position">Pos</abbr>'
local show_status = yesno(Args['show_status'] or 'yes') and true or false
end
 
-- Add source to title if specified and possible
-- Get VTE button text (but only for non-empty text)
local title_source = false
local template_name = Args['template_name'] or ''
if Args['title'] and Args['title_source'] then
local VTE_text = ''
Args['title'] = Args['title'] .. Args['title_source']
if template_name~='' then
title_source = true
VTE_text = frame:expandTemplate{ title = 'navbar', args = { mini=1, style='float:right', template_name} }
elseif Args['table_header'] and Args['table_header_source'] then
Args['table_header'] = Args['table_header'] .. Args['table_header_source']
title_source = true
end
 
-- Write column headers
t_return = p_style.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt)
if match_table then
-- Add empty column header
t_return.count = t_return.count+1
table.insert(t_return.tab_text,'! scope="row" class="unsortable" style="background-color:white;border-top:white;border-bottom:white;line-width:3pt;"| \n')
 
-- Add rest of header
t_return = p_matches.header(t_return,Args,p_sub,N_teams,team_list,tonumber(Args['legs']) or 1)
end
t = t_return.tab_text
local N_cols = t_return.count
 
-- Determine what entries go into table
-- Find out which team to show (if any)
local ii_show = team_list[firstnonblank(PargsArgs['showteam'], Args['showteam'])or nil] -- nil if non-existant
-- Start and end positions to show
local n_to_show = tonumber(Args['show_limit']) or N_teams
Riga 182 ⟶ 210:
end
end
 
-- For results column
local new_res_ii = ii_start
-- Pre-check for existence of column
if not hide_results then
for ii = ii_start, ii_end do
for ii = ii_start, ii_end do
if Args['result'..ii] then results_defined = true end
if Args[respre..'result'..ii] and Args[respre..'text_' .. Args[respre..'result'..ii]] then results_defined = true end
end
end
-- Remove results header if it is unused
Riga 198 ⟶ 228:
table.insert(t, t_str)
end
 
-- Write rows
local team_name, team_code_ii, team_code_jj, pos_num, group_txt, note_local
Riga 212 ⟶ 242:
team_name = Args['name_'..team_code_ii] or team_code_ii
note_local = Args['note_'..team_code_ii] or nil
 
-- Does it need a promotion/qualification/relegation tag
local result_local = Args[respre..'result'..ii] or nil
local bg_col = nil
-- Get local background colour
if result_local then
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'whiteinherit'
bg_col = 'background-color:'..bg_col..';' -- Full style tag
end
if not bg_col then bg_col = 'background-color:transparent;' end -- Becomes default if undefined
 
-- Bold this line or not
local ii_fw = ii == ii_show and 'font-weight: bold;' or 'font-weight: normal;'
if yesno(Args['show_totals'] or 'no') and team_code_ii == total_row_name then
ii_fw = 'font-weight: bold;'
end
 
-- Check whether there is a note or not, if so get text ready for it
if note_local and full_table then
Riga 232 ⟶ 265:
-- There are now 3 options for notes
-- 1) It is a full note
-- 2) It is a referalreferral to another note (i.e. it's just a team code; e.g. note_AAA=Text, note_BBB=AAA) in which the note for BBB should link to the same footnote as AAA, with
-- 2a) The other linked note exist in the part of the table shown
-- 2b) The part of the note does not exist in the part of the table shown
Riga 240 ⟶ 273:
note_id = '"table_note_'..team_code_ii..rand_val..'"' -- Add random end for unique ID if more tables are present on article (which might otherwise share an ID)
note_id_list[team_code_ii] = note_id
 
-- Call refn template
note_string = frame:expandTemplate{ title = 'efn', args = { group='Table_notes', name=note_id, note_local} }
else
-- Option 2
-- It is option 2a in either one if either the main note is inside the sub-table
-- or another ref to that note is inside the sub-table
-- Basically when it either has been defined, or the main link will be in the table
note_local_num = team_list[note_local]
Riga 252 ⟶ 285:
-- Option 2a
note_id = '"table_note_'..note_local..rand_val..'"'
note_string = frame:extensionTagexpandTemplate{ nametitle = 'refefn', args = { group = 'lower-alpha', name = note_id} }
else
-- Option 2b
Riga 258 ⟶ 291:
note_id = '"table_note_'..note_local..rand_val..'"' -- Add random end for unique ID
note_id_list[note_local] = note_id
 
-- Call refn template
note_string = frame:expandTemplate{ title = 'efn', args = { group='Table_notes', name=note_id, Args['note_'..note_local]} }
end
end
Riga 266 ⟶ 299:
note_string = '';
end
 
-- Insert status when needed
local status_string = ''
local status_local = show_status and Args[respre .. 'status_'..team_code_ii] or nil
local status_let_first = true
local curr_letter
Riga 289 ⟶ 322:
end
end
end
-- Only add brackets/dash and bolding if it exist
if not status_let_first then
if t_status.position == 'before' then
status_string = '<span style="font-weight:bold">'..string.lower(status_string)..' &ndash;</span> '
else
status_string = ' <span style="font-weight:bold">('..status_string..')</span>'
end
end
end
 
-- Now build the rows
if yesno(Args['show_totals'] or 'no') and team_code_ii == total_row_name then
table.insert(t,'|- \n') -- New row
table.insert(t,'!|- scopeclass="rowsortbottom" style="text-align: center;'..ii_fw..bg_col..'"| '..pos_num..'\n') -- PositionNew numberrow
else
table.insert(t,'|- \n') -- New row
end
if position_col then
table.insert(t,'| style="text-align: center;'..ii_fw..bg_col..'"| '..pos_num..'\n') -- Position number
end
if full_table and group_col then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..group_txt..'\n') -- Group number/name
end
-- Build the team string order based on status position
Riga 313 ⟶ 352:
team_string = team_name..note_string..status_string
end
table.insert(t,'|! scope="row" style="text-align: left; white-space:nowrap;'..ii_fw..bg_col..'"| '..team_string..'\n')-- Team (with possible note)
-- Call to subfunction
t_return = p_style.row(frame,t,Args,p_sub,notes_exist,hth_id_list,full_table,rand_val,team_list,team_code_ii,ii_start,ii_end,ii_fw,bg_col,N_teams,ii,ii_show)
Riga 319 ⟶ 358:
notes_exist = t_return.notes_exist
hth_id_list = t_return.hth_id_list
 
-- Now check what needs to be added inside the results column
if full_table then
Riga 327 ⟶ 366:
N_rows_res = 1
jjj = ii+1
result_local = Args[respre..'result'..ii] or ''
local cont_loop = true
while (jjj<=ii_end) and cont_loop do
Riga 334 ⟶ 373:
new_res_ii = jjj
else
res_jjj = Args[respre..'result'..jjj] or ''
if result_local == res_jjj then
N_rows_res = N_rows_res+1
else
cont_loop = false
Riga 353 ⟶ 392:
-- Get background colour
bg_col = nil
if Args[respre..'result'..ii] then
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'whiteinherit'
bg_col = 'background-color:'..bg_col..';' -- Full style tag
end
if not bg_col then bg_col = 'background-color:transparent;' end -- Becomes default if undefined
-- Check for notes
local note_res_string, note_ref, note_text = '', '', ''
if Args['note_res_'..result_local] then
notes_exist = true
local note_res_local = Args['note_res_'..result_local]
 
if not Args['note_res_'..note_res_local] then
-- Split the note_res_local into a table if all the entries are valid
-- It does not point to another result note
local multiref = 1
note_ref = 'res_'..result_local
local note_res_local_table = mw.text.split(note_res_local, '%s*,%s*')
note_id = '"table_note_res_'..result_local..rand_val..'"' -- Identifier
if (#note_res_local_table > 1) then
note_text = note_res_local
for k, note_res_loc in ipairs(note_res_local_table) do
multiref = multiref * (Args['note_res_' .. note_res_loc] and 1 or 0)
end
else
multiref = 0
-- It does point to another result note
note_ref = 'res_'..note_res_local
note_id = '"table_note_res_'..note_res_local..rand_val..'"' -- Identifier
note_text = Args['note_res_'..note_res_local]
end
 
-- Check whether it is already printed
-- Split failed, so make a single entry table with hth_local inside
if not note_id_list[note_ref] then
--if Printmultiref it< 1 then
note_res_local_table = { note_res_local }
note_id_list[note_ref] = note_id
end
note_res_string = frame:expandTemplate{ title = 'efn', args = { group='Table_notes', name=note_id, note_text} }
 
else
for k,note_res_local in ipairs(note_res_local_table) do
-- Refer to it
if not Args['note_res_'..note_res_local] then
note_res_string = frame:extensionTag{ name = 'ref', args = { group = 'lower-alpha', name = note_id} }
-- It does not point to another result note
note_ref = respre..'res_'..result_local
note_id = '"table_note_res_'..result_local..rand_val..'"' -- Identifier
note_text = note_res_local
else
-- It does point to another result note
note_ref = respre..'res_'..note_res_local
note_id = '"table_note_res_'..note_res_local..rand_val..'"' -- Identifier
note_text = Args['note_res_'..note_res_local]
end
-- Check whether it is already printed
if not note_id_list[note_ref] then
-- Print it
note_id_list[note_ref] = note_id
note_res_string = note_res_string .. frame:expandTemplate{ title = 'efn', args = { name=note_id, note_text} }
else
-- Refer to it
note_res_string = note_res_string .. frame:expandTemplate{ title = 'efn', args = {name = note_id} }
end
end
else
note_res_string = ''
end
-- Get text
local text_result = Args[respre..'text_'..result_local] or ''
if text_result:match('fbmulticomp') then
ii_fw = 'padding:0;' .. ii_fw
if text_result:match('fbmulticompefn') then
notes_exist = true
end
end
text_field_result = '| style="'..ii_fw..bg_col..'" rowspan="'..tostring(N_rows_res)..'" |'..text_result..note_res_string..'\n'
-- See whether it is needed (only when blank for all entries)
Riga 393 ⟶ 455:
end
end
 
-- Insert match row if needed
if match_table then
local legs = tonumber(Args['legs']) or 1
-- Add empty cell
table.insert(t,'| style="background-color:white;border-top:white;border-bottom:white;"| \n')
 
-- Now include note to match results if needed
for jj=top_pos,N_teams do
team_code_jj = team_list[jj]
Riga 405 ⟶ 468:
-- Nothing
else
for l=1,legs do
local match_note = Args['match_'..team_code_ii..'_'..team_code_jj..'_note']
local m = (legs == 1) and 'match_' or 'match' .. l .. '_'
if match_note then
local match_note = Args[m..team_code_ii..'_'..team_code_jj..'_note']
notes_exist = true
--if Onlymatch_note when it existthen
notes_exist = true
-- First check for existence of reference for note
-- Only when it exist
if not (Args['note_'..match_note] or Args['match_'..match_note..'_note']) then
-- It'sFirst thecheck entryfor existence of reference for note
if not (Args['note_'..match_note] or Args[m..match_note..'_note']) then
note_id = '"table_note_'..team_code_ii..'_'..team_code_jj..rand_val..'"' -- Add random end for unique ID if more tables are present on article (which might otherwise share an ID)
-- It's the entry
note_id_list[team_code_ii..'_'..team_code_jj] = note_id
note_id = '"table_note_'..team_code_ii..'_'..team_code_jj..rand_val..'"' -- Add random end for unique ID if more tables are present on article (which might otherwise share an ID)
note_id_list[team_code_ii..'_'..team_code_jj] = note_id
note_string = frame:expandTemplate{ title = 'efn', args = { group='Table_notes', name=note_id, match_note} }
 
else
note_string = frame:expandTemplate{ title = 'efn', args = { name=note_id, match_note} }
-- Check for existence elsewhere
note_local_num = team_list[match_note] or ii_end + 1
if note_id_list[match_note] or ((note_local_num >= ii_start) and (note_local_num <= ii_end)) then
-- It exists
note_id = '"table_note_'..match_note..rand_val..'"' -- Identifier
note_string = frame:extensionTag{ name = 'ref', args = { group = 'lower-alpha', name = note_id} }
else
-- NowCheck definefor the identifier forexistence thiselsewhere
note_idnote_local_num = '"table_note_'..team_list[match_note..rand_val..'"'] --or Addii_end random+ end for unique ID1
if note_id_list[match_note] or ((note_local_num >= note_idii_start) and (note_local_num <= ii_end)) then
-- CallIt refn templateexists
note_id = '"table_note_'..match_note..rand_val..'"' -- Identifier
note_string = frame:expandTemplate{ title = 'efn', args = { group='Table_notes', name=note_id, Args['note_'..match_note]} }
note_string = frame:expandTemplate{ title = 'efn', args = {name = note_id} }
else
-- Now define the identifier for this
note_id = '"table_note_'..match_note..rand_val..'"' -- Add random end for unique ID
note_id_list[match_note] = note_id
-- Call refn template
note_string = frame:expandTemplate{ title = 'efn', args = { name=note_id, Args['note_'..match_note]} }
end
end
end
 
-- Now append this to the match result string
Args['match_'m..team_code_ii..'_'..team_code_jj] = (Args['match_'m..team_code_ii..'_'..team_code_jj] or '')..note_string
end
end
end
end
 
-- Add rest of match row
t = p_matches.row(t,Args,N_teams,team_list,ii,ii_show,legs)
end
 
-- Now, if needed, insert a split (solid line to indicate split in standings, but only when it is not at the last shown position)
if Args['split'..ii] and (ii<ii_end) then
Riga 449 ⟶ 515:
end
end
 
-- Close table
table.insert(t, '|}\n')
 
-- Get info for footer
local update = Args['update'] or 'unknown'
local start_date = Args['start_date'] or 'unknown'
local source = Args['source'] or frame:expandTemplate{ title(title_source = 'citation needed', args = {true reason='Noand source parameter defined', date=os.date('%B %Y') } }
or ''
local class_rules = Args['class_rules'] or nil
 
-- Create footer text
-- Date updating
local matches_text = Args['matches_text'] or 'match(es)'
if string.lower(update)=='complete' then
-- Do nothing
elseif update=='' then
-- Empty parameter
table.insert(t_footer,'UpdatedAggiornato toal '..matches_textupdate..' played on unknown. ')
elseif string.lower(update)=='future' then
-- Future start date
table.insert(t_footer,'FirstData '..matches_text..'di will be played oninizio: '..start_date..'. ')
else
table.insert(t_footer,'UpdatedAggiornato to '..matches_text..' played onal '..update..'. ')
end
 
-- Stack footer or not
local stack_footer_valfooter_break = firstnonblankyesno(PargsArgs['stack_footer'], Args[or 'stack_footerno']) and true or 'no'false
 
local footer_break = false
if yesno(stack_footer_val) then footer_break = true end
-- Variable for linebreak
local stack_string = '<br/>'
 
if footer_break and (not (string.lower(update)=='complete')) then table.insert(t_footer,stack_string) end
 
if source ~= '' then
table.insert(t_footer,'Source: '..source)
table.insert(t_footer,'Fonte: '..source)
if class_rules and full_table and (not hide_class_rules) then
table.insert(t_footer,'<br>Rules for classification: '..class_rules)
end
if class_rules and full_table and show_class_rules then
if (#t_footer > 0) then table.insert(t_footer,'<br/>') end
table.insert(t_footer,'Regole per gli ex aequo: '..class_rules)
end
 
-- Now for the named status
local status_exist = false
Riga 507 ⟶ 575:
end
end
-- Now end it with a point instead (if it contains entries the '; ' needs to be removed)
if status_exist then
if (#t_footer > 0) then table.insert(t_footer,'<br/>') end
status_string = '<br>'..mw.ustring.sub(status_string,1,mw.ustring.len(status_string)-2)..'.'
status_string = mw.ustring.sub(status_string,1,mw.ustring.len(status_string)-2)
table.insert(t_footer,status_string)
end
 
-- Add notes (if applicable)
if notes_exist then
if (#t_footer > 0) then table.insert(t_footer,'<br/>Notes:') end
table.insert(t_footer,'Note:')
-- As reflist size text
t_footer = '<div class="reflistsports-table-notes">'..table.concat(t_footer)..'</div>'
t_footer = t_footer..frame:expandTemplate{ title = 'notelist',Gruppo argsdi = { group='Table_notesnote'} }
else
-- As reflist size text
t_footer = '<div class="reflistsports-table-notes">'..table.concat(t_footer)..'</div>'
end
 
-- Add footer to main text table
table.insert(t,t_footer)
 
-- Rewrite anchor links
return table.concat(t)
for k=1,#t do
if t[k]:match('%[%[#[^%[%]]*%|') then
t[k] = mw.ustring.gsub(t[k], '(%[%[)(#[^%[%]]*%|)', '%1' .. baselink .. '%2')
end
end
 
-- Generate tracking
if not Args['notracking'] then
local getTracking = require('Module:Sports table/argcheck').check
local warning_categories, tracking_categories = getTracking(Args, frame:getParent().args)
if #warning_categories > 0 then
if frame:preprocess( "{{REVISIONID}}" ) == "" then
for k=1,#warning_categories do
warning_categories[k] = mw.ustring.gsub(warning_categories[k], '^%[%[Category:Pages using sports table with (.*)|(.*)%]%]$', '<div style="color:red">Warning: %1 = %2</div>')
end
end
end
for k=1,#warning_categories do
table.insert(t, warning_categories[k])
end
for k=1,#tracking_categories do
table.insert(t, tracking_categories[k])
end
 
if(Args['showteam'] == nil) then
local getWarnings = require('Module:Sports table/totalscheck').check
local total_warnings = getWarnings(Args, team_list, ii_start, ii_end)
if #total_warnings > 0 then
if frame:preprocess( "{{REVISIONID}}" ) == "" then
for k=1,#total_warnings do
table.insert(t, '<div style="color:green">Possibile problema: ' .. total_warnings[k] .. '</div>')
end
end
end
end
else
table.insert(t, '[[Categoria:Errori nella compilazione di SportsTable]]')
end
 
if Args['float'] then
return frame:expandTemplate{ title = 'stack begin', args = {clear = 'true', margin = '1', float = Args['float']} }
.. templatestyles .. '\n' .. table.concat(t) .. frame:expandTemplate{ title = 'stack end'}
end
 
return templatestyles .. '\n' .. table.concat(t)
end
 
return p