Editing Module:Infobox Recipe/Sandbox
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 85: | Line 85: | ||
--Set SMW properties |
--Set SMW properties |
||
⚫ | |||
local smw_properties = { |
|||
mw.smw.set({ |
|||
['Uses item'] = {}, |
|||
[ |
["Uses item"] = material.name, |
||
["Uses item_and_quantity"] = material.name .. ',' .. tostring(material.quantity) |
|||
⚫ | |||
}) |
|||
⚫ | |||
end |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
if args.facility then |
|||
⚫ | |||
mw.smw.set({ |
|||
table.insert(smw_properties['Uses item'], material.name) |
|||
⚫ | |||
table.insert(smw_properties['Uses item and quantity'], ('%s,%s'):format(material.name, material.quantity)) |
|||
}) |
|||
end |
|||
⚫ | |||
if args.duration then |
|||
mw.smw.set({ |
|||
⚫ | |||
}) |
|||
end |
|||
if args.kp then |
|||
mw.smw.set({ |
|||
["has kp"] = args.kp |
|||
}) |
|||
end |
end |
||
mw.smw.set(smw_properties) |
|||
--Creates a row suitable for the raw materials section of the infobox. |
--Creates a row suitable for the raw materials section of the infobox. |
||
Line 212: | Line 222: | ||
:attr{ colspan = '5' } |
:attr{ colspan = '5' } |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext(hc(args.kp) and |
:wikitext(hc(args.kp) and (args.kp) or editButton("'''?''' (edit)")) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '5' } |
:attr{ colspan = '5' } |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext(hc(args. |
:wikitext(hc(args.xp) and (args.xp) or editButton("'''?''' (edit)")) |
||
:done() |
:done() |
||
:done() |
:done() |