local me = { }
local pp = { }
local nhlData
local yesno = require('Module:Yesno')
-- if mw.loadData() not supported, use require() instead
return ret
end
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
return
'{| class="wikitable sortable" width="" style="text-align:center;"\
|+ [[' .. tableHeaderInfo.divisionLink.. '|' .. tableHeaderInfo.division .. ']]' ..tableHeaderInfo.source.. '\
! width=32 | <abbr title="Position">Pos</abbr>\
! width=190 | Team ' .. tableHeaderInfo.navbarText .. '\
standingsPage,
mini = 1,
style = 'float:leftright;',
})
local matches_text = mw.text.trim(frame.args.matches_text or 'games')
if string.lower(update)=='complete' then
table.insert(t_footer,'Final standings.'..tableHeaderInfo.source..'')
elseif update=='' then
-- Empty
table.insert(t_footer,'Updated to '..matches_text..' played on '..update..'.'..tableHeaderInfo.source..'')
end
local stack_footer_val = mw.text.trim(frame.args.stack_footer or 'no')
local footer_break = false
if yesno(stack_footer_val) then footer_break = true end
local stack_string = '<br>'
local t_status = mw.text.split(status_listArg, '%s*,%s*')
local status_exist = false
local status_string = ''
local curr_letter
for jjj = 1,mw.ustring.len(t_status.letters) do
curr_letter = mw.ustring.upper(mw.ustring.sub(t_status.letters,jjj,jjj))
if t_status.called[curr_letter] then
if (footer_beark and status_exist) then
status_string = status_string..stack_string
end
status_exist = true
end
end
if status_exist then
status_string = 'br'..mw.ustring.sub(status_string,1,mw.ustring.len(status_string)-2)..'.'
table.insert(t_footer,status_string)
end
return table.concat(outputBuffer), table.concat(t_footer)
end -- function me.generateStandingsTable()
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 = { E='Eliminated from playoff contention', P='Clinched Presidents Trophy',
X='Clinched playoff spot', Y='Clinched division', Z='Clinched conference'}
status_called = {E=false, P=false, X=false, Y=false, Z=false}
local status_letters = 'EPXYZ'
return {code=status_code, called=status_called, letters=status_letters}
end
function me.generateStandingsTable_fromTemplate(frame)
|