Module:Infobox Recipe/Sandbox: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(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: | Line 92: | ||
end |
end |
||
-- these are for when a recipe is called by a subsequent recipe that uses showFull |
|||
if args.facility then |
if args.facility then |
||
mw.smw.set({ |
mw.smw.set({ |
||
Line 98: | Line 99: | ||
end |
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. |
--Creates a row suitable for the raw materials section of the infobox. |
||
Line 166: | Line 172: | ||
:attr{ colspan = '11' } |
: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)")) |
: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() |
:done() |