Module:Infobox Recipe/Sandbox: Difference between revisions

set to current version of main infobox
(center some cells)
(set to current version of main infobox)
 
(2 intermediate revisions by the same user not shown)
Line 85:
 
--Set SMW properties
local smw_properties = {
for _,material in ipairs(argsMaterials) do
['Uses item'] = {},
mw.smw.set({
["'Uses item" and quantity'] = material.name{},
-- these are for when a recipe is called by a subsequent recipe that uses showFull
["Uses item_and_quantity"] = material.name .. ',' .. tostring(material.quantity)
["'Uses facility"'] = args.facility,
})
-- not implemented yet, for addinadding to timeduration if showfull is true
["'Uses duration"'] = args.duration,
}
for _, material in ipairs(argsMaterials) do
table.insert(smw_properties['Uses item'], material.name)
table.insert(smw_properties['Uses item and quantity'], ('%s,%s'):format(material.name, material.quantity))
end
 
mw.smw.set(smw_properties)
-- these are for when a recipe is called by a subsequent recipe that uses showFull
if args.facility then
mw.smw.set({
["Uses facility"] = args.facility
})
end
-- not implemented yet, for addin to time if showfull is true
if args.duration then
mw.smw.set({
["Uses duration"] = args.duration
})
end
 
--Creates a row suitable for the raw materials section of the infobox.
Line 179 ⟶ 173:
:tag('th')
:attr{ colspan = '2' }
:wikitext('TimeDuration')
:done()
:tag('td')
Line 197 ⟶ 191:
:done()
:tag('th')
:attr{ colspan = '105' }
:wikitext('KP')
:done()
:tag('th')
:attr{ colspan = '5' }
:wikitext('XP')
:done()
Line 212 ⟶ 210:
:done()
:tag('td')
:attr{ colspan = '105' }
:css{ ['text-align'] = 'center' }
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)"))
:done()
:tag('td')
:attr{ colspan = '5' }
:css{ ['text-align'] = 'center' }
:wikitext(hc(args.exp) and (args.exp) or editButton("'''?''' (edit)"))
11,277

edits