Module:CIB: Difference between revisions

From The Satanic Wiki
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 6: Line 6:
local args = frame:getParent().args
local args = frame:getParent().args
local headerStyle
local headerStyle
if args.headerstyle and args.headerstyle ~= '' then
if args.headerstyle and args.headerstyle ~= nil then
headerStyle = string.format('background-color:%s;', args.headerstyle)
headerStyle = string.format('background-color:%s;', args.headerstyle)
else
else
Line 14: Line 14:
headerStyle = headerStyle,  
headerStyle = headerStyle,  
} )
} )
if args.title ~= '' then
if args.title ~= nil then
p:addHeader( args.title );
p:addHeader( args.title );
end
end
if args.image ~= '' then
if args.image ~= nil then
p:addImage( args.image, args.caption );
p:addImage( args.image, args.caption );
end
end
if args.born ~= '' then
if args.born ~= nil then
p:addRow( 'Born', args.born );
p:addRow( 'Born', args.born );
end
end
if args.alias ~= '' then
if args.alias ~= nil then
p:addRow( 'Other Names', args.alias );
p:addRow( 'Other Names', args.alias );
end
end
if args.occupation ~= '' then
if args.occupation ~= nil then
p:addRow( 'Occupation', args.occupation );
p:addRow( 'Occupation', args.occupation );
end
end
if args.affiliation ~= '' then
if args.affiliation ~= nil then
p:addRow( 'Satanic Affiliation', args.affiliation );
p:addRow( 'Satanic Affiliation', args.affiliation );
end
end
if args.established ~= '' then
if args.established ~= nil then
p:addRow( 'Established', args.established );
p:addRow( 'Established', args.established );
end
end
if args.entity_type ~= '' then
if args.entity_type ~= nil then
p:addRow( 'Entity Type', args.entity_type );
p:addRow( 'Entity Type', args.entity_type );
end
end
if args.incorporated_state ~= '' then
if args.incorporated_state ~= nil then
p:addRow( 'Incorporated State', args.incorporated_state );
p:addRow( 'Incorporated State', args.incorporated_state );
end
end
if args.state_id ~= '' then
if args.state_id ~= nil then
p:addRow( 'State ID#', args.state_id );
p:addRow( 'State ID#', args.state_id );
end
end
if args.ein ~= '' then
if args.ein ~= nil then
p:addRow( 'EIN', args.ein );
p:addRow( 'EIN', args.ein );
end
end
if args.physical_address ~= '' then
if args.physical_address ~= nil then
p:addRow( 'Physical Address', args.physical_address );
p:addRow( 'Physical Address', args.physical_address );
end
end
if args.mail_address ~= '' then
if args.mail_address ~= nil then
p:addRow( 'Mail Address', args.mail_address );
p:addRow( 'Mail Address', args.mail_address );
end
end
if args.registered_agent ~= '' then
if args.registered_agent ~= nil then
p:addRow( 'Registered Agent', args.registered_agent );
p:addRow( 'Registered Agent', args.registered_agent );
end
end
if args.doing_business_as ~= '' then
if args.doing_business_as ~= nil then
p:addRow( 'Doing Business As', args.doing_business_as );
p:addRow( 'Doing Business As', args.doing_business_as );
end
end
if args.past_names ~= '' then
if args.past_names ~= nil then
p:addRow( 'Past Names', args.past_names );
p:addRow( 'Past Names', args.past_names );
end
end
if args.website ~= ''then
if args.website ~= nil then
p:addRow( 'Website', args.website );
p:addRow( 'Website', args.website );
end
end

Revision as of 02:46, 24 June 2021

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

local capiunto = require 'capiunto'

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local headerStyle
	if args.headerstyle and args.headerstyle ~= nil then
		headerStyle = string.format('background-color:%s;', args.headerstyle)
	else
		headerStyle = 'background-color:grey;'
	end
	local retval = capiunto.create( {
		headerStyle = headerStyle, 
	} )
	if args.title ~= nil then
		p:addHeader( args.title );
	end
	if args.image ~= nil then
		p:addImage( args.image, args.caption );
	end
	if args.born ~= nil then
		p:addRow( 'Born', args.born );
	end
	if args.alias ~= nil then
		p:addRow( 'Other Names', args.alias );
	end
	if args.occupation ~= nil then
		p:addRow( 'Occupation', args.occupation );
	end
	if args.affiliation ~= nil then
		p:addRow( 'Satanic Affiliation', args.affiliation );
	end
	if args.established ~= nil then
		p:addRow( 'Established', args.established );
	end
	if args.entity_type ~= nil then
		p:addRow( 'Entity Type', args.entity_type );
	end
	if args.incorporated_state ~= nil then
		p:addRow( 'Incorporated State', args.incorporated_state );
	end
	if args.state_id ~= nil then
		p:addRow( 'State ID#', args.state_id );
	end
	if args.ein ~= nil then
		p:addRow( 'EIN', args.ein );
	end
	if args.physical_address ~= nil then
		p:addRow( 'Physical Address', args.physical_address );
	end
	if args.mail_address ~= nil then
		p:addRow( 'Mail Address', args.mail_address );
	end
	if args.registered_agent ~= nil then
		p:addRow( 'Registered Agent', args.registered_agent );
	end
	if args.doing_business_as ~= nil then
		p:addRow( 'Doing Business As', args.doing_business_as );
	end
	if args.past_names ~= nil then
		p:addRow( 'Past Names', args.past_names );
	end
	if args.website ~= nil then
		p:addRow( 'Website', args.website );
	end
	
	return retval
	
	end
return p