Module:QuestDetails: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
local p = {}
local p = {}

local Infobox = require('Module:Infobox')
local parse = require('Module:Param Parse')


function p.details(frame)
function p.details(frame)
local args = frame:getParent().args
local args = frame:getParent().args
local config = {
local params = {}
params['start_point'] = 'value1'
infobox_name = 'QuestDetails',
params['requirements'] = 'value2'
class = 'questdetails',
}
mw.smw.set(params)
local params = {
local div = 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 div
{ 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
end