Module:Episode list: Difference between revisions

m
1 revision imported
(Undid revision 779735210 by AussieLegend (talk) restoring edits. Makes more sense to have the page be working when the bot saves it)
 
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 39:
local title = mw.title.getCurrentTitle()
local page_title = mw.title.getCurrentTitle().text
local initiallist_titlemainlist = args.MainList or args['1'] or ''
-- Is this list on the same page as the page directly calling the template?
local on_initial_pageon_main_page
-- Only sublist had anything about hiding, so only it needs to even check
if sublist then
on_initial_pageon_main_page = mw.uri.anchorEncode(page_title) == mw.uri.anchorEncode(initiallist_titlemainlist)
-- avoid processing ghost references
if not on_initial_pageon_main_page then
args.ShortSummary = nil
end
else
-- Normal lists can ALWAYS show the summary
on_main_page = false
on_initial_page = true
end
Line 127:
if args.TopColor then
top_color = '#'..args.TopColor
elseif row_color and on_initial_pagenot on_main_page and mm._mod(epn,2) == 0 then
top_color = '#E9E9E9'
elseif on_initial_pagenot on_main_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 on_initial_pagenot on_main_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 on_initial_pagenot on_main_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 on_initial_pagenot on_main_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 initial listmainlist page
-- Do include it on all other lists
if on_initial_pagenot on_main_page and args.ShortSummary then
local bottom_wrapper = mw.html.create('tr')
-- fix for lists in the Short Summary