Module:Issue banner

--[=[ Implements issue banner templates ]=] require('strict')

local getArgs = require('Module:Arguments').getArgs local yesno = require('Module:Yesno') local make_style_string = require('Module:Optional style').make_style_string

local p = {}

local function div_with_style(class, style_args) local class = '' if args.class then class = 'class:' .. args.class .. ';'	end return '' end

function p._issue_banner(args) local style_args = { ['border-top'] = args['border-top'] or args.border, ['border-bottom'] = args['border-bottom'] or args.border, ['style'] = args.style }	local main_div = div_with_style('issue-banner', style_args) -- left local left_cell = div_with_style(nil, {['style'] = args.lstyle}) .. (args.left or args[1] or '') .. ' '	local lbrace_cell = '' if yesno(args.lbrace) then lbrace_cell = div_with_style('brace', {['font-size'] = args['lbrace-size'] or args['brace-size']}) .. '} '	end local center_left_cell = '' if args['center-left'] then center_left_cell = div_with_style(nil, {['style'] = args.cstyle}) .. args['center-left'] .. ' '	end local left_content = ' ' .. left_cell .. lbrace_cell .. center_left_cell .. ' '	-- center local center_content = '' local center = args.center or args[2] if center then center_content = div_with_style(nil, {['style'] = args.cstyle}) .. center .. ' '	end -- right local center_right_cell = '' if args['center-right'] then center_right_cell = div_with_style(nil, {['style'] = args.cstyle}) .. args['center-right'] .. ' '	end local rbrace_cell = '' if yesno(args.rbrace) then rbrace_cell = div_with_style('brace', {['font-size'] = args['rbrace-size'] or args['brace-size']}) .. '{ '	end local right_cell = div_with_style(nil, {['style'] = args.rstyle}) .. (args.right or args[3] or '') .. ' '	local right_content = ' ' .. center_right_cell .. rbrace_cell .. right_cell .. ' '	return main_div .. left_content .. center_content .. right_content .. ' ' end

function p.issue_banner(frame) return p._issue_banner(getArgs(frame)) end

return p