Module:Copied/sandbox: Difference between revisions

Content deleted Content added
m Reverted edits by MJL (talk) to last version by Chlod
Prevent getting incorrectly put into Category:Wikipedia pages using copied template without oldid when using a fromX higher than 1
Line 132:
local text = "Text has been copied to or from this %s; 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. %s"
text = string.format(text, pageType, historyList)
return text
end
 
local function categories(args,multiUsed)
local to_oldid = args["to_oldid"] or args["to_diff"] or args["diff"]
local from_oldid = args["from_oldid"]
local text = "[[Category:Wikipedia pages using copied template]]"
if ((not from_oldid) or (not to_oldid)) and not multiUsed then
text = string.format("%s[[Category:Wikipedia pages using copied template without oldid]]",text)
end
return text
end
Line 140 ⟶ 150:
local from2 = args["from2"]
if (from2) then
text = multiText(args) .. categories(args,true)
elseif (not from2) then
text = singleText(args) .. categories(args,false)
end
return text
Line 154 ⟶ 164:
text = BannerText(args)
})
end
 
local function categories(args)
local to_oldid = args["to_oldid"] or args["to_diff"] or args["diff"]
local from_oldid = args["from_oldid"]
local text = "[[Category:Wikipedia pages using copied template]]"
if ((not from_oldid) or (not to_oldid)) then
text = string.format("%s[[Category:Wikipedia pages using copied template without oldid]]",text)
end
return text
end
 
Line 169:
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
return renderBanner(args) .. categories(args)
end