Module:QuestDetails: Difference between revisions

563 bytes removed ,  Yesterday at 20:55
no edit summary
No edit summary
No edit summary
Line 1:
local p = {}
 
local Infobox = require('Module:Infobox')
local parse = require('Module:Param Parse')
 
function p.details(frame)
local args = frame:getParent().args
local configparams = {}
params['start_point'] = 'value1'
infobox_name = 'QuestDetails',
params['requirements'] = 'value2'
class = 'questdetails',
}
mw.smw.set(params)
local paramsdiv = {mw.html.create( 'div' )
div:wikitext( "Testing" )
{name = 'start_point', func = parse.has_content, smw_property = 'Start Point'},
if (args[1]) then
{name = 'requirements', func = parse.has_content, smw_property = 'Requirements'}
div:wikitext( args[1].tostring() )
}
end
if (args[2]) then
local infobox = Infobox.new(config, params, args)
div:wikitext( args[2].tostring() )
local auto_width = { ["max-width"] = "85%", ["width"] = "auto" }
end
infobox
 
:add_row{
return infoboxdiv
{ tag = 'th', class = "questdetails-header", content = 'Start Point' },
{ tag = 'td', class = "questdetails-info", content=Infobox.param('start_point'), css = auto_width }
}
:add_row{
{ tag = 'th', class = "questdetails-header", content = 'Requirements' },
{tag = 'td', class = "questdetails-info", content=Infobox.param('requirements'), colspan='2' },
}
return infobox
end
 
545

edits