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

local galleryincomplete = {}
local getArgs = require('Dev:Arguments').getArgs

function galleryincomplete.main(frame)
	local args = getArgs(frame)
	return galleryincomplete._main(args)
end

function galleryincomplete._main(args)
    local container = mw.html.create('div')
        :attr('id', 'mntExpand')
        :addClass('section-needed')
 
    local image = container:tag('span')
        :addClass('image')
        :css('text-align', 'center')
        :wikitext('[[File:Relm-ffvi-snes-battle.png|25px]]')
    
    local neededtable = {}
	for i, needed in ipairs(args) do
		table.insert(neededtable, needed)
	end
	local neededtext = ''
	if #neededtable > 0 then
        neededtext = table.concat(neededtable, ', ', 1, #neededtable - 1)
    	if #neededtable > 1 then
    		neededtext = neededtext .. ' and '
    	end
        neededtext = neededtext .. neededtable[#neededtable]
    else neededtext = '[[Project:Media|images]]'
    end
    
    local beginningtext = 'This gallery is incomplete '
    local extratext = 'and requires ' .. neededtext .. ' added'
    local closingtext = 'You can help the '..mw.site.siteName..' by [[Special:Upload|uploading images]]'
 
    local text = container:tag('span')
        :addClass('text')
        :css('left', '-40px')
        :css('padding-left', '40px')
        :wikitext(beginningtext .. extratext .. '. ' .. closingtext .. '.')
    
    local category = container:wikitext('[' .. '[' .. 'Category:Image needed' .. ']' .. ']')
        
    return container
end

return galleryincomplete
Community content is available under CC-BY-SA unless otherwise noted.