Module:Infobox Recipe: Difference between revisions

Link all images to the item/facility; Get rid of border between item image and name
(Switch to mw.html fluent builder; Use {{Currency cell}} to align currency)
(Link all images to the item/facility; Get rid of border between item image and name)
Line 1:
local currency = require('Module:Currency')
local parse = require('Module:Param Parse')
local yn = require('Module:Yesno')
 
local function currency_cell(amount)
Line 9 ⟶ 11:
function p._main(frame)
local args = frame:getParent().args
local parse = require('Module:Param Parse')
local yn = require('Module:Yesno')
 
--If set to true, will check if any of the items passed as a rawmaterialparam are actually intermediate materials. Will then change the display order of the infobox.
Line 93:
return mw.html.create('tr')
:tag('td')
:css{ ['border-right'] = 'none' }
:wikitext('[[File:' .. item.name .. '.png|30px|link=' .. item.name .. ']]')
:done()
:tag('td')
:css{ ['border-left'] = 'none' }
:wikitext('[[' .. item.name .. ']]')
:done()
Line 111 ⟶ 113:
return mw.html.create('tr')
:tag('td')
:css{ ['border-right'] = 'none' }
:wikitext('[[File:' .. item .. '.png|30px|link=' .. item .. ']]')
:done()
:tag('td')
:css{ ['border-left'] = 'none' }
:wikitext('[[' .. item .. ']]')
:done()
Line 123 ⟶ 127:
:attr{ colspan = '10' }
:css{ ['text-align'] = 'right' }
:wikitext('[[File:' .. facility .. '.png|30px|link=' .. facility .. ']] [[' .. facility .. ']]')
:done()
:done()
Line 144 ⟶ 148:
:tag('td')
:attr{ colspan = '11' }
:wikitext(args.facility and ('[[' .File:%s.png|link=%s|30px]] [[%s]]'):format(args.facility, args..facility, ']]'args.facility) or 'Unknown')
:done()
:done()
Line 253 ⟶ 257:
:tag('tr')
:tag('td')
:css{ ['border-right'] = 'none' }
:wikitext('[[File:' .. args.output1 .. '.png|30px|link=' .. args.output1 .. ']]')
:done()
:tag('td')
:css{ ['border-left'] = 'none' }
:wikitext(args.output1 and '[[' .. args.output1 .. ']]' or 'Unknown')
:done()
138

edits