Module:Episode list: Difference between revisions

Content deleted Content added
Updates per talk page
Tag: Reverted
Undid revision 1143972210 by Alex 21 (talk)
Line 40:
'EpisodeNumber',
'EpisodeNumber2',
'Title',
'Aux1',
'DirectedBy',
Line 306 ⟶ 305:
 
return args
end
 
--[[
Local function which is used to create column cells.
 
EpisodeNumber, EpisodeNumber2 and Title are created in different functions
as they require some various if checks.
 
See:
-- createEpisodeNumberCell()
-- createEpisodeNumberCellSecondary()
-- createTitleCell()
]]--
local function createCells(args, isSerial, currentRow, onInitialPage, title, numberOfParameterGroups)
for k, v in ipairs(cellNameList) do
if (v == 'ProdCode') then
createProductionCodeCell(args, v)
elseif (args[v] and (v ~= 'EpisodeNumber' and v ~= 'EpisodeNumber2')) then
-- Set empty cells to TBA/TBD
if (args[v] == '') then
createEmptyCell(args, v, false)
elseif (v == 'WrittenBy' and title.namespace == 0) then
if ((string.find(args[v], "''Story") ~= nil or string.find(args[v], "''Teleplay") ~= nil) and string.find(args[v], "8202") == nil) then
--   is the hairspace added through {{StoryTeleplay}}
addTrackingCategory(trackingCategoryList["raw_unformatted_storyteleplay"])
end
end
 
-- If serial titles need to be centered and not left, then this should be removed.
local textAlign = "center"
if (v == 'Aux1' and isSerial) then
textAlign = "left"
end
 
-- Remove wikilinks from links in serial rowspans rows after the first.
-- if (currentRow > 1) then
-- args[v] = removeWikilinks(args, v)
-- end
 
local thisRowspan
if (not parameterGroupCells[v] and parameterGroupCellsAny) then
thisRowspan = numberOfParameterGroups
else
thisRowspan = 1
end
 
if (currentRow == 1 or (currentRow > 1 and parameterGroupCells[v])) then
createTableData(args[v], thisRowspan, textAlign)
end
nonNilParams = nonNilParams + 1
checkUsageOfDateTemplates(args, v, onInitialPage, title)
end
 
if (args[v] == "TBA") then
cellValueTBA = true
end
end
end
 
Line 461 ⟶ 517:
 
-- Local function which is used to create a Title cell.
local function createTitleCell(args, numberOfParameterGroups, imultiTitleListEnabled, isSerial)
local titleText
local isCellPresent
 
if (tonumber(numberOfParameterGroups) > 1multiTitleListEnabled) then
titleText, isCellPresent = processMultiTitleList(args, numberOfParameterGroups)
local args, nextGroupValid = extractDataFromNumberedTitleArgs(args, i)
else
titleText, isCellPresent = createTitleText(args)
end
titleText, isCellPresent = createTitleText(args)
 
if (isCellPresent == false) then
Line 514 ⟶ 571:
 
nonNilParams = nonNilParams + 1
end
 
--[[
Local function which is used to create column cells.
 
EpisodeNumber, EpisodeNumber2 are created in different functions
as they require some various if checks.
 
See:
-- createEpisodeNumberCell()
-- createEpisodeNumberCellSecondary()
]]--
local function createCells(args, isSerial, currentRow, onInitialPage, title, numberOfParameterGroups)
for k, v in ipairs(cellNameList) do
if (v == 'ProdCode') then
createProductionCodeCell(args, v)
elseif (v == 'Title') then
local isSerial = not args.Title_2 and true or false
createTitleCell(args, numberOfParameterGroups, currentRow, isSerial)
elseif (args[v] and (v ~= 'EpisodeNumber' and v ~= 'EpisodeNumber2')) then
-- Set empty cells to TBA/TBD
if (args[v] == '') then
createEmptyCell(args, v, false)
elseif (v == 'WrittenBy' and title.namespace == 0) then
if ((string.find(args[v], "''Story") ~= nil or string.find(args[v], "''Teleplay") ~= nil) and string.find(args[v], "8202") == nil) then
--   is the hairspace added through {{StoryTeleplay}}
addTrackingCategory(trackingCategoryList["raw_unformatted_storyteleplay"])
end
end
 
-- If serial titles need to be centered and not left, then this should be removed.
local textAlign = "center"
if (v == 'Aux1' and isSerial) then
textAlign = "left"
end
 
local thisRowspan
if (not parameterGroupCells[v] and parameterGroupCellsAny) then
thisRowspan = numberOfParameterGroups
else
thisRowspan = 1
end
 
if (currentRow == 1 or (currentRow > 1 and parameterGroupCells[v])) then
createTableData(args[v], thisRowspan, textAlign)
end
nonNilParams = nonNilParams + 1
checkUsageOfDateTemplates(args, v, onInitialPage, title)
end
 
if (args[v] == "TBA") then
cellValueTBA = true
end
end
end
 
Line 670 ⟶ 673:
createEpisodeNumberCell(args, 1, false)
createEpisodeNumberCellSecondary(args, 1, false)
createTitleCell(args, numberOfParameterGroups, multiTitleListEnabled, false)
createCells(args, false, 1, onInitialPage, title, numberOfParameterGroups)
end
Line 675 ⟶ 679:
-- Local function which is used to create a multiple row of cells.
-- This function is called when part of the row is rowspaned.
-- Current use is for Doctor Who serials.
local function createMultiRowCells(args, numberOfParameterGroups, onInitialPage, title, topColor)
local EpisodeNumberSplit = (args.EpisodeNumber_1 and true or false)
Line 684 ⟶ 689:
createEpisodeNumberCell(args, numberOfParameterGroups, EpisodeNumberSplit)
createEpisodeNumberCellSecondary(args, numberOfParameterGroups, EpisodeNumberSplit)
end
if (i == 1) then
createTitleCell(args, numberOfParameterGroups, false, true)
end
Line 812 ⟶ 821:
local numberOfParameterGroups, multiTitleListEnabled = getnumberOfParameterGroups(args)
 
if (multiTitleListEnabled and not args.Title_2) then
createMultiRowCells(args, numberOfParameterGroups, onInitialPage, title, topColor)
else