Editing Module:Infobox Recipe
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 1: | Line 1: | ||
require('strict') |
|||
require('Module:Mw.html extension') |
|||
local currency = require('Module:Currency') |
local currency = require('Module:Currency') |
||
local |
local parse = require('Module:Param Parse') |
||
local yn = require('Module:Yesno') |
local yn = require('Module:Yesno') |
||
local editButton = require('Module:Edit button') |
|||
local function currency_cell(amount) |
local function currency_cell(amount) |
||
Line 30: | Line 27: | ||
--get the value for the output product |
--get the value for the output product |
||
local output1Value = 0 |
local output1Value = args.output1 and mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1') or 0 |
||
if args.output1 then |
|||
output1Value = mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1') or 0 |
|||
end |
|||
--Calculate total value of output material(s) |
--Calculate total value of output material(s) |
||
local output1TotalValue = 0 |
local output1TotalValue = 0 |
||
Line 102: | Line 96: | ||
--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) |
||
rawMaterialCost = rawMaterialCost + materialBuyPrice |
rawMaterialCost = rawMaterialCost + materialBuyPrice |
||
return mw.html.create('tr') |
return mw.html.create('tr') |
||
Line 165: | Line 159: | ||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '11' } |
:attr{ colspan = '11' } |
||
:wikitext |
:wikitext(args.facility and ('[[File:%s.png|link=%s|30px]] [[%s]]'):format(args.facility, args.facility, args.facility) or 'Unknown') |
||
:done() |
:done() |
||
:done() |
:done() |
||
Line 186: | Line 179: | ||
:attr{ colspan = '2' } |
:attr{ colspan = '2' } |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext |
:wikitext(args.profession and '[[' .. args.profession .. ']]' or 'Unknown') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext |
:wikitext(args.level or 'Unknown') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '10' } |
:attr{ colspan = '10' } |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext |
:wikitext(args.exp or 'Unknown') |
||
:done() |
:done() |
||
:done() |
:done() |
||
Line 272: | Line 265: | ||
:done() |
:done() |
||
:done() |
:done() |
||
:IF(args.output1) |
|||
-- Values |
-- Values |
||
:tag('tr') |
|||
:tag('td') |
|||
:css{ ['border-right'] = 'none' } |
|||
:wikitext('[[File:' .. args.output1 .. '.png|30px|link=' .. args.output1 .. ']]') |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
:tag('td') |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
:done() |
:done() |
||
: |
:tag('td') |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
:tag('tr') |
:tag('tr') |
||
:addClass('currency') |
:addClass('currency') |