Module:Episode list: Difference between revisions

Content deleted Content added
Copy further from initial row
Comment out per talk page
 
(17 intermediate revisions by 6 users not shown)
Line 188:
local function setTBDStatus(args, awaitingText, expiredText, weeks)
if args.OriginalAirDate == nil or args.OriginalAirDate == '' then
return tableEmptyCellModule._main({alt_text = awaitingText, title_text = awaitingText})
end
 
-- If it hasn't aired, change to "N/A".
if string.match(args.OriginalAirDate, '^Unaired') then
return tableEmptyCellModule._main({alt_text = "N/A"})
end
 
local month, day, year = args.OriginalAirDate:gsub(" ", " "):match("(%a+) (%d+), (%d+)")
 
Line 223 ⟶ 228:
 
if (seconds >= 60 * 60 * 24 * 7 * weeks) then
return tableEmptyCellModule._main({alt_text = expiredText, title_text = expiredText})
else
return tableEmptyCellModule._main({alt_text = awaitingText, title_text = awaitingText})
end
end
Line 245 ⟶ 250:
-- Air dates that don't use {{Start date}}
local function checkUsageOfDateTemplates(args, v, onInitialPage, title)
if (v == 'OriginalAirDate'
and args[v] ~= ''
and string.match(args[v], '%d%d%d%d') ~=-- nilEnsure it contains a four-digit number (likely a year)
and string.match(args[v], '2C2C2C') == nil -- Avoids this specific pattern
and not string.findmatch(args[v], 'itvstart^Unaired') == nil -- itvstartExclude isanything astarting {{Startwith date}} unique class."Unaired"
--and string.find(args[v], "film%-date"'itvstart') ~== nil -- ChecksAvoids thata {{FilmStart date}} isn'tunique used as it uses {{Start date}}.class
and onInitialPage
and title.namespace == 0)
then
addTrackingCategory(trackingCategoryList["air_dates"])
Line 293 ⟶ 298:
use the non-numbered parameter names (Title, Aux).
 
The function returns the args as non-numbered prameterparameter names.
]]--
local function extractDataFromNumberedSerialArgs(args, i, numberOfParameterGroups, title)
Line 372 ⟶ 377:
elseif (hasValue(args.TranslitTitle)) then
if (hasValue(args.NativeTitleLangCode)) then
titleString = titleString .. 'Transliteration: "' .. langModule._transl_xlit({args.NativeTitleLangCode, args.TranslitTitle, italic = 'no'}) .. '"'
else
titleString = titleString .. 'Transliteration: "' .. args.TranslitTitle .. '"'
Line 391 ⟶ 396:
if (hasValue(args.NativeTitleLangCode)) then
local languageCode = "Lang-" .. args.NativeTitleLangCode
titleString = titleString .. " (" .. langModule._lang_xx_inherit_langx({code = args.NativeTitleLangCode, text=args.NativeTitle}) .. ")"
else
titleString = titleString .. " (" .. args.NativeTitle .. ")"
Line 418 ⟶ 423:
Local function which is used to extract data
from the numbered title parameters (Title1, RTitle2, etc.), and then convert them to
use the non-numbered prameterparameter names (Title, RTitle).
 
The function returns two results:
Line 535 ⟶ 540:
-- 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
Line 552 ⟶ 557:
checkUsageOfDateTemplates(args, v, onInitialPage, title)
end
 
-- Usages of TBA via [[Template:TableTBA]] can be found with the "tv-tba" class.
if (args[v] == "TBA") then
if args[v] and (args[v] == "TBA" or string.find(args[v], "tv%-tba")) then
cellValueTBA = true
end
Line 722 ⟶ 728:
return '#' .. args.TopColor
end
elseif (rowColorEnabled and onInitialPage and mathModule._mod(episodeNumber, 2) == 0) then
return '#E9E9E9'
elseif (onInitialPage and args.ShortSummary) then
return '#F2F2F2'
else
return 'inherit'
Line 765 ⟶ 767:
-- with one of them not requiring an article name, so for backward compatability, the whole sequence is kept.
local onInitialPage
local onInitialPageCheck = (mw.uri.anchorEncode(pageTitle) == mw.uri.anchorEncode(initiallistTitle))
 
-- Only sublist had anything about hiding, so only it needs to even check
if (sublist) then
onInitialPage = mw.uri.anchorEncode(pageTitle) == mw.uri.anchorEncode(initiallistTitle)onInitialPageCheck
-- avoid processing ghost references
if (not onInitialPage) then
Line 777 ⟶ 780:
onInitialPage = true
else
onInitialPage = mw.uri.anchorEncode(pageTitle) == mw.uri.anchorEncode(initiallistTitle)onInitialPageCheck
end
end