Module:Infobox Recipe/Sandbox: Difference between revisions

implement "duration" field for the time it takes
(Created page with "require('strict') require('Module:Mw.html extension') local currency = require('Module:Currency') local hc = require('Module:Param Parse').has_content local yn = require('Module:Yesno') local editButton = require('Module:Edit button') local function currency_cell(amount) return currency._cell(amount, { html = 'yes' }) end local p = {} function p._main(frame) local args = frame:getParent().args --If set to true, will check if any of the items passed as a rawmateria...")
 
(implement "duration" field for the time it takes)
Line 92:
end
-- these are for when a recipe is called by a subsequent recipe that uses showFull
if args.facility then
mw.smw.set({
Line 98 ⟶ 99:
end
 
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 166 ⟶ 172:
:attr{ colspan = '11' }
:wikitext(hc(args.facility) and ('[[File:%s.png|link=%s|30px]] [[%s]]'):format(args.facility, args.facility, args.facility) or editButton("'''?''' (edit)"))
 
:done()
:done()
:tag('tr')
:tag('th')
:attr{ colspan = '2' }
:wikitext('Time')
:done()
:tag('td')
:attr{ colspan = '11' }
:wikitext(hc(args.duration) and ('%s s'):format(args.duration) or editButton("'''?''' (edit)"))
 
:done()
11,274

edits