Module:Infobox military conflict

require('Module:No globals')

local p = {}

local getArgs = require('Module:Arguments').getArgs local InfoboxImage = require('Module:InfoboxImage').InfoboxImage

function p.main(frame) local args = getArgs(frame, {wrappers = 'Template:Infobox military conflict'})

local combatants if args.combatants then combatants = tonumber(args.combatants) else combatants = args.combatant3 and 3 or 2 end

local builder = mw.html.create if args.campaignbox then builder = builder:tag('table') :css('float', 'right') :css('clear', 'right') :css('background', 'transparent') :css('margin', 0) :css('padding', 0) :tag('tr'):tag('td') end builder:wikitext('') builder:tag('tr') :wikitext(string.format('%s ', combatants, frame:expandTemplate{title = 'WPMILHIST Infobox style', args = {'header_bar'}}, args.conflict or mw.title.getCurrentTitle.text ))	if args.partof then builder:tag('tr') :wikitext(string.format('Part of %s ', combatants, frame:expandTemplate{title = 'WPMILHIST Infobox style', args = {'sub_header_bar'}}, args.partof ))	end if args.image then local alt if args.caption then alt = (args.alt or '') .. ' ' .. args.caption else alt = args.alt end local imageArgs = { image = args.image, size = args.image_size, sizedefault = 'frameless', upright = 1, alt = alt }		builder:tag('tr') :wikitext(string.format('%s ', combatants, frame:expandTemplate{title = 'WPMILHIST Infobox style', args = {'image_box'}}, InfoboxImage{args = imageArgs} ))	end end

return p