Module:Fair use

From the Tesseract Wiki, the wiki for all things Marvel Cinematic Universe
Jump to navigation Jump to search

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

local p = {}

function p.invoke_main(frame)
	local args = frame:getParent().args
	return p.main(args)
end

function p.main(args, itype)
	local box =  "{| class=\"messagebox info fairuse\"\n"
	box = box .. "| [[File:Copyright.svg|35px|center]] || '''This image, obtained outside of the ''Marvel Cinematic Universe'', is classified as a [[Wikipedia:Free content|non-free image]].'''<br clear=\"all\">"
	box = box .. "<div style=\"font-size:0.85em; line-height:1.4em;\">The image depicted here is subject to " .. (args.owner or "[[Wikipedia:Marvel Studios|Marvel Studios']]") .. " copyright and is displayed here under the conditions of [[Wikipedia:Fair use|fair use]]."
	local link = args[1] or args.link
	if link ~= nil and string.len(link) > 0 then
		box = box .. "<br />Image source: " .. (args.description or "") .. " [" .. (args[1] or args.link) .. " " .. (args[1] or args.link) .. "].</div>"
	end
	box = box .. "\n|}"
	if mw.title.getCurrentTitle().namespace == 6 then
		box = box .. "[[Category:Non-free images]]"
		if itype then
			box = box .. "[[Category:" .. itype .. "]]"
		end
		if args.author then
			for author in string.gmatch(args.author, "[^,]+") do
				box = box .. "[[Category:Images created by " .. author .. "]]"
			end
		end
	end
	return box
end

function p.conceptart(frame)
	local args = frame:getParent().args
	return p.main(args, 'Concept art')
end

return p