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: | ||
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 28: | Line 27: | ||
--get the value for the output product |
--get the value for the output product |
||
local output1Value = |
local output1Value = args.output1 and mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1') |
||
⚫ | |||
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 |
||
if |
if output1Value[1]['Value'] ~= nil then |
||
output1TotalValue = output1Value[1]['Value'] * (tonumber(args.output1qty) or 1) |
|||
⚫ | |||
output1TotalValue = output1Value[1]['Value'] * (tonumber(args.output1qty) or 1) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
end |
|||
end |
end |
||
Line 163: | Line 157: | ||
: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 184: | Line 177: | ||
: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 270: | Line 263: | ||
:done() |
:done() |
||
:done() |
:done() |
||
if args.output1 then |
|||
⚫ | |||
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 .. ']] |
:wikitext('[[File:' .. args.output1 .. '.png|30px|link=' .. args.output1 .. ']]') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:css{ ['border-left'] = 'none' } |
:css{ ['border-left'] = 'none' } |
||
:wikitext('[[' .. args.output1 .. ']]' or 'Unknown') |
:wikitext(args.output1 and '[[' .. args.output1 .. ']]' or 'Unknown') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
Line 289: | Line 280: | ||
:wikitext(currency_cell(output1TotalValue)) |
:wikitext(currency_cell(output1TotalValue)) |
||
:done() |
:done() |
||
end |
|||
-- Add profit data |
-- Add profit data |
||
out |
|||
:tag('tr') |
:tag('tr') |
||
:tag('th') |
:tag('th') |