![]() | This Lua module is used on approximately 40,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
![]() | This module depends on the following other modules: |
This module implements {{Copied}}. Please see the template page for documentation.
local MessageBox = require('Module:Message box')
local p = {}
local function singleText()
from_oldid = frame.args["from_oldid"]
from = frame.args["from"]
to_diff = frame.args["to_diff"]
to_oldid = frame.args["to_oldid"]
to = frame.args["to"]
date = frame.args["date"]
afd = frame.args["afd"]
text = "Text and/or other creative content from "
if not (from_oldid == "" or from_oldid == nil) then
text = text .. "[{{fullurl:" .. from .. "|oldid=" .. from_oldid .. "this version] of "
end
text = text .. "[[" .. from .."]]"
text = text .. " was copied or moved into "
text = text .. "[[" .. to .. "]]"
if not (diff == "" or diff == nil) then
text = text .. " with [" .. diff .. "|this edit]"
elseif not (to_oldid == "" or to_oldid == nil) then
text = text .. "with [{{fullurl:" .. to .. "|diff=" .. to_diff .. "&oldid=" .. to_oldid .. "}}|this edit]"
end
if not (date == "" or date == nil) then
text = text .. " on " .. date
end
if not (afd == "" or afd == nil) then
text = text .. " after being [[Wikipedia:Articles for deletion/" .. afd "|nominated for deletion]]."
end
text = text .. ". The former page's "
text = text .. history()
text = text .. "now serves to [[WP:Copying within Wikipedia|provide attribution]] for that content in the latter page, and it must not be deleted so long as the latter page exists."
return text
end
local function multiText()
collapse = frame.args["collapse"]
text = "Text has been copied to or from this {{#ifeq:{{SUBJECTSPACE}}||article|page}}; see the list below. The source pages now serve to [[WP:Copying within Wikipedia|provide attribution]] for the content in the destination pages and must not be deleted so long as the copies exist. For attribution and to access older versions of the copied text, please see the history links below."
if collapse == 'yes' then
text = text .. '<table style="width:100%; background: transparent;" class="collapsible collapsed">\n<tr><th>Copied pages:</th></tr>\n<tr><td>'
end
text = text .. list()
if collapse == 'yes' then
text = text .. '</td></tr></table>'
end
return text
end
local function BannerText()
local text
from2 = frame.args["from2"]
if not (from2 == nil or from2 == "") then
text = singleText()
else
text = multiText()
end
return text
end
local function renderBanner()
return MessageBox.main('tmbox', {
small = frame.args["small"],
type = 'notice',
image = '[[File:Splitsection.svg|50px]]',
smallimage = 'none',
text = BannerText()
})
end
function p.main(frame)
return renderBanner()
end
return p