Module:Room features: Difference between revisions
hide loc qty if 1, add version name
m (BlackHawk moved page Module:Location features to Module:Room features without leaving a redirect) |
(hide loc qty if 1, add version name) |
||
Line 56:
local image = v.image_sub or v.image or 'File:Section anchor light.svg'
local quantity = ''
if v['Location quantity'] and (v['Location quantity'] ~= 'Unknown' and v['Location quantity'] ~= '1') then
quantity = string.format('%s × ', v['Location quantity'])
end
local version_name = ''
local version = string.match(obj_name, "[^#]+%#([^#]+)")
if version then
version_name = string.format(" <sub>''%s''</sub>", version)
end
local display_name = v.name_sub or v.name
gallery = gallery .. string.format('%s|%s[[%s|%s%s]]\n', image, quantity, obj_name, display_name, version_name)
end
gallery = gallery .. '</gallery>\n\n'
Line 67 ⟶ 74:
end
end
return frame:preprocess(ret)
|