Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

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

local f = {}

function f.main(frame)
	local result = {}
	
	local game = frame:getParent().args["game"] or ""
	local album = frame:getParent().args["album"] or ""
	local description = frame:getParent().args["description"] or ""
	local user = frame:getParent().args["user"] or ""
	local source = frame:getParent().args["source"] or nil
	local date = frame:getParent().args["date"] or ""
	
	local panel_game = '<tr><th>Game</th><td>[['.. game ..']]</td></tr>'
	local panel_album = '<tr><th>Album</th><td>[['.. album ..']]</td></tr>'
	local panel_description = '<tr><th>Description</th><td>'.. description ..'</td></tr>'
	local panel_date = '<tr><th>Date</th><td>'.. date ..'</td></tr>'
	local panel_source = '<tr><th>Source</th><td>'.. source ..'</td></tr>'
	local panel_user = '<tr><th>User</th><td>[[user:'.. user ..'|'.. user ..']]</td></tr>'
	
	if game == "" then panel_game = "" end
	if album == "" then panel_album = "" end
	if user == "" then panel_user = "" end
	
	if description == "" or description == nil then 
		panel_description = "[[Category:Files without a description]]"
	end
	
	local panel = '<table class="wikitable filetemplate" style="width: 100%"><tr><th colspan="2" style="text-align:center">File information</th></tr>'.. panel_game .. panel_album .. panel_description .. panel_date .. panel_source .. panel_user ..'</table>'
	
	table.insert(result, panel)
	return table.concat(result, "")
end

return f