Module:Infobox Recipe: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
The Gaffer (talk | contribs) No edit summary |
(Fix raw material quantity not multiplying price) |
||
Line 1: | Line 1: | ||
require('strict') |
|||
require('Module:Mw.html extension') |
|||
local currency = require('Module:Currency') |
local currency = require('Module:Currency') |
||
local hc = require('Module:Param Parse').has_content |
local hc = require('Module:Param Parse').has_content |
||
Line 100: | Line 102: | ||
--Creates a row suitable for the raw materials section of the infobox. |
--Creates a row suitable for the raw materials section of the infobox. |
||
local function createRawMaterialRow(item) |
local function createRawMaterialRow(item) |
||
local materialBuyPrice = getBuyPrice(item) |
local materialBuyPrice = getBuyPrice(item) * (item.quantity or 1) |
||
rawMaterialCost = rawMaterialCost + materialBuyPrice |
rawMaterialCost = rawMaterialCost + materialBuyPrice |
||
return mw.html.create('tr') |
return mw.html.create('tr') |
||
Line 270: | Line 272: | ||
:done() |
:done() |
||
:done() |
:done() |
||
:IF(args.output1) |
|||
out |
|||
-- Values |
-- Values |
||
:tag('tr') |
:tag('tr') |
||
:tag('td') |
:tag('td') |
||
:css{ ['border-right'] = 'none' } |
:css{ ['border-right'] = 'none' } |
||
:wikitext('[[File:' .. args.output1 .. '.png|30px|link=' .. args.output1 .. ']]' or 'Unknown') |
:wikitext('[[File:' .. args.output1 .. '.png|30px|link=' .. args.output1 .. ']]' or 'Unknown') |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
:tag('td') |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
:done() |
:done() |
||
:END() |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end |
|||
⚫ | |||
out |
|||
:tag('tr') |
:tag('tr') |
||
:tag('th') |
:tag('th') |