Jump to content

Module:Reprint license

From Wikisource

--[=[
Implements [[Template:Reprint license]]
]=]

local p = {} --p stands for package

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

local license_scope = require('Module:License scope')._license_scope
local license_grammar = require('Module:License scope')._license_grammar
local license_collapsible_container = require('Module:Translation license')._license_collapsible_container
local no_license = require('Module:Translation license')._no_license

local namespace = mw.title.getCurrentTitle().nsText

function p._reprint_license(args)
	local original = args.original or no_license({['scope'] = 'original content'})
	local new = args.new or no_license({['scope'] = 'new material'})
	local message = license_scope() .. license_grammar({' a newer edition of a previously copyrighted work that contains', ' newer editions of previously copyrighted works that contain'}) .. ' new material additions such as the cover image, front matter or end matter.'
	
	return license_collapsible_container({
		['message'] = message,
		[1] = 'Original:',
		[2] = original,
		[3] = 'New material:',
		[4] = new
	})
end

function p.reprint_license(frame)
	return p._reprint_license(getArgs(frame))
end

return p