Module:Amulets/infobox

--- Amulets/infobox builds the infobox on amulet pages.

-- @module     amulets -- @author FINNER --

return { --- Builds the amulet infobox. --	@function		p.buildInfobox --	@param			{table} frame Frame object --	@return			{string} Wikitext of infobox buildInfobox = function(frame) local args = frame.args;--require('Dev:Arguments').getArgs(frame); local name = args['Name']; local amulet = {}

amulet = mw.loadData(Module:Amulets/data)[name];

local infobox = mw.html.create('infobox') :tag('title') :tag('default') :tag('b'):wikitext(name):done :done :done :tag('image'):attr('source', 'Image') :tag('default'):wikitext(amulet.Image):done :done :tag('data'):attr('source', 'Category') :tag('label'):wikitext('Category'):done :tag('default'):wikitext(amulet.Category or 'Unknown'):done :done :tag('data'):attr('source', 'Tier') :tag('label'):wikitext('Tier'):done :tag('default'):wikitext(amulet.Tier or 'Unknown'):done :done :tag('data'):attr('source', 'Effects') :tag('label'):wikitext('Effects'):done :tag('default'):wikitext(amulet.Effects or 'Unknown'):done :done :tag('data'):attr('source', 'GearScore') :tag('label'):wikitext('Gear Score'):done :tag('default'):wikitext(amulet.GearScore or 'Unknown'):done :done :tag('data'):attr('source', 'Source') :tag('label'):wikitext('Source'):done :tag('default'):wikitext(amulet.Source or 'Unknown'):done :done :tag('data'):attr('source', 'Weight') :tag('label'):wikitext('Weight'):done :tag('default'):wikitext(amulet.Weight or 'Unknown'):done :done :tag('data'):attr('source', 'Buy') :tag('label'):wikitext('Buy'):done :tag('default'):wikitext(amulet.Buy or 'Unknown'):done :done :tag('data'):attr('source', 'Sell') :tag('label'):wikitext('Sell'):done :tag('default'):wikitext(amulet.Sell or 'Unknown'):done :done :tag('data'):attr('source', 'BOP') :tag('label'):wikitext('BOP'):done :tag('default'):wikitext(amulet.BOP or 'Unknown'):done :done :tag('data'):attr('source', 'Resource') :tag('label'):wikitext('Resource'):done :tag('default'):wikitext(amulet.Resource or 'Unknown'):done :done :tag('data'):attr('source', 'Salvageable') :tag('label'):wikitext('Salvageable'):done :tag('default'):wikitext(amulet.Salvageable or 'Unknown'):done :done :tag('data'):attr('source', 'Tradeable') :tag('label'):wikitext('Tradeable'):done :tag('default'):wikitext(amulet.Tradeable or 'Unknown'):done :done

return frame:preprocess(tostring(infobox)) end }