Module:Episode list: Difference between revisions

Content deleted Content added
Reverted to revision 747245865 by AlexTheWhovian (talk): Revert apparently faulty edits. (TW)
Update /sublist usage.
Line 39:
local title = mw.title.getCurrentTitle()
local page_title = mw.title.getCurrentTitle().text
local mainlistinitiallist_title = args.MainList or args['1'] or ''
-- Is this list on the same page as the page directly calling the template?
local on_main_pageon_initial_page
-- Only sublist had anything about hiding, so only it needs to even check
if sublist then
on_main_pageon_initial_page = mw.uri.anchorEncode(page_title) == mw.uri.anchorEncode(mainlistinitiallist_title)
-- avoid processing ghost references
if on_main_pagenot on_initial_page then
args.ShortSummary = nil
end
else
-- Normal lists can ALWAYS show the summary
on_initial_page = true
on_main_page = false
end
Line 127:
if args.TopColor then
top_color = '#'..args.TopColor
elseif row_color and not on_main_pageon_initial_page and mm._mod(epn,2) == 0 then
top_color = '#E9E9E9'
elseif not on_main_pageon_initial_page and args.ShortSummary then
top_color = '#F2F2F2'
else
Line 195:
elseif args[v] then
-- Air dates that don't use {{Start date}}
if v == 'OriginalAirDate' and args[v] ~= '' and string.match(args[v], '%d%d%d%d') ~= nil and string.find(args[v],'dtstart') == nil and not on_main_pageon_initial_page and title.namespace == 0 then
categories = categories..'[[Category:Episode lists with unformatted air dates]]'
end
-- Alternate air dates that do use {{Start date}}
if v == 'AltDate' and args[v] ~= '' and string.find(args[v],'dtstart') ~= nil and not on_main_pageon_initial_page and title.namespace == 0 then
categories = categories..'[[Category:Episode lists with incorrectly formatted alternate air dates]]'
end
Line 233:
-- add these categories only in the mainspace and only if they are on the page where the template is used
if not on_main_pageon_initial_page and title.namespace == 0 then
if args.LineColor and args.LineColor ~= '' then
local black_cr = contrast_ratio{args.LineColor, 'black', ['error'] = 0}
Line 261:
end
-- Do not show the summary if this is being transcluded on the mainlistinitial list page
-- Do include it on all other lists
if not on_main_pageon_initial_page and args.ShortSummary then
local bottom_wrapper = mw.html.create('tr')
-- fix for lists in the Short Summary