Editing Module:Infobox Episode
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 9: | Line 9: | ||
local config = { |
local config = { |
||
infobox_name = 'Episode', |
infobox_name = 'Episode', |
||
class = {Infobox.param('name')}, |
|||
} |
} |
||
Line 16: | Line 15: | ||
parse.image, |
parse.image, |
||
parse.release, |
parse.release, |
||
parse.premium, |
|||
-- Premium manually defined in episode infoboxes |
|||
{ name = 'premium', func = parse.yes_no, smw_property = 'Premium', smw_func = parse.yes_no_smw, category_incomplete = 'Needs premium status' }, |
|||
{ name = 'sequence_number', func = parse.number, smw_property = 'Episode sequence number', smw_func = parse.number, category_incomplete = 'Needs episode sequence number' }, |
|||
} |
} |
||
local infobox = Infobox.new(config, params, args) |
local infobox = Infobox.new(config, params, args) |
||
infobox |
infobox |
||
Line 38: | Line 35: | ||
} |
} |
||
:pad(20) |
:pad(20) |
||
if infobox:is_param_defined(Infobox.param('sequence_number')) > 0 then |
|||
local sequence_number = tonumber(infobox:get_param(Infobox.param('sequence_number'), 0)) |
|||
if sequence_number > 10 then |
|||
error('Please change [[Module:Infobox Episode]] to pad episode number to be 2 digits long (e.g., "Episode 01: Hopeport") to preserve sorting') |
|||
end |
|||
frame:callParserFunction{ name = 'DEFAULTSORT', args = ('Episode %d: %s'):format(sequence_number, infobox:get_param(Infobox.param('name'), 0)) } |
|||
end |
|||
return infobox |
return infobox |
||
end |
end |