Module:Param Parse: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
mNo edit summary |
(Try to prettify invalid profession bubbles) |
||
Line 227: | Line 227: | ||
function parse.profession_bubble_func(profession, level) |
function parse.profession_bubble_func(profession, level) |
||
local profession_valid = parse.has_content(profession) |
local profession_valid = parse.has_content(profession) |
||
local profession_valid_link = profession_valid |
|||
local level_valid = parse.number(level) |
local level_valid = parse.number(level) |
||
local category_error = false |
local category_error = false |
||
Line 234: | Line 235: | ||
if not profession_valid and level_valid then |
if not profession_valid and level_valid then |
||
-- Profession undefined but level defined, invalid, show an unknown profession |
-- Profession undefined but level defined, invalid, show an unknown profession |
||
profession_valid = 'Unknown |
profession_valid = 'Unknown episode' |
||
profession_valid_link = '' |
|||
category_error = true |
category_error = true |
||
end |
end |
||
Line 242: | Line 244: | ||
category_error = true |
category_error = true |
||
end |
end |
||
return '[[File:'..profession_valid..' icon.png|x30px|link='.. |
return '[[File:'..profession_valid..' icon.png|x30px|link='..profession_valid_link..']] '..level_valid..(category_error and '[[Category:Invalid profession bubble]]' or '') |
||
end |
end |
||
function parse.profession_bubble_smw(profession, level) |
function parse.profession_bubble_smw(profession, level) |