Difference between revisions of "Module:Drop"

From Curse of Aros
Jump to: navigation, search
Line 8: Line 8:
 
row:tag('td'):attr('style', 'text-align:left'):wikitext(item.inline(args.Name))
 
row:tag('td'):attr('style', 'text-align:left'):wikitext(item.inline(args.Name))
 
row:tag('td'):wikitext(args.Quantity)
 
row:tag('td'):wikitext(args.Quantity)
row:tag('td'):wikitext(args.Rarity)
+
 +
local rarity = row:tag('td'):wikitext(args.Rarity)
 +
if args.Rarity == 'Rare' then
 +
rarity:attr('style', 'background-color: #FF863C')
 +
end
 
 
 
     return tostring(row)
 
     return tostring(row)

Revision as of 13:29, 17 November 2019

Documentation for this module may be created at Module:Drop/doc

local export = {}
local item = require('Module:Item')

function export.main(frame)
	local args = frame:getParent().args
	local row = mw.html.create('tr'):addClass('coa-drop-row')
	
	row:tag('td'):attr('style', 'text-align:left'):wikitext(item.inline(args.Name))
	row:tag('td'):wikitext(args.Quantity)
	
	local rarity = row:tag('td'):wikitext(args.Rarity)
	if args.Rarity == 'Rare' then
		rarity:attr('style', 'background-color: #FF863C')
	end
	
    return tostring(row)
end

return export