Module:Copied: Difference between revisions

mw-collapsed
m (1 revision imported)
(mw-collapsed)
Line 17: Line 17:
text = string.format("%s [[%s]]",text,from)
text = string.format("%s [[%s]]",text,from)
if (merge == "yes") or not (afd == "") then
if (merge == "yes") or not (afd == "") then
text = string.format("%s was merged into",text)
text = text .. " was merged into"
else  
else  
text = string.format("%s was copied or moved into",text)
text = text .. " was copied or moved into"
end  
end  
if (merge == "yes") and (to == "") then
if (merge == "yes") and (to == "") then
Line 44: Line 44:
end
end
end
end
text = string.format("%s.",text) -- Finish first sentance  
text = text .. "." -- Finish first sentance  
text = string.format("%s The former page's [%s history] 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.",text,tostring(mw.uri.fullUrl(from,{action="history"}) or ""))
text = string.format("%s The former page's [%s history] 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.",text,tostring(mw.uri.fullUrl(from,{action="history"}) or ""))
return text
return text
Line 126: Line 126:
local historyList = list(args)
local historyList = list(args)
if (args["collapse"] == 'yes') then
if (args["collapse"] == 'yes') then
local collapsedText = '<table style="width:100%%; background: transparent;" class="collapsible collapsed">\n<tr><th>Copied pages:</th></tr>\n<tr><td> %s </td></tr></table>'
local collapsedText = '<table style="width:100%%; background: transparent;" class="mw-collapsible mw-collapsed">\n<tr><th>Copied pages:</th></tr>\n<tr><td> %s </td></tr></table>'
historyList = string.format(collapsedText, historyList)
historyList = string.format(collapsedText, historyList)
end
end
Line 132: 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"
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)
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"] or args["to_oldid1"] or args["to_diff1"] or args["diff1"]
local from_oldid = args["from_oldid"] or args["from_oldid1"]
local text = "[[Category:Wikipedia pages using copied template]]"
if ((not from_oldid) or (not to_oldid)) and not multiUsed then
text = text .. "[[Category:Wikipedia pages using copied template without oldid]]"
end
return text
return text
end
end
Line 140: Line 150:
local from2 = args["from2"]
local from2 = args["from2"]
if (from2) then
if (from2) then
text = multiText(args)
text = multiText(args) .. categories(args,true)
elseif (not from2) then
else
text = singleText(args)
text = singleText(args) .. categories(args,false)
end
end
return text
return text
Line 154: Line 164:
text = BannerText(args)
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
end


Line 169: Line 169:
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
local args = getArgs(frame)
return renderBanner(args) .. categories(args)
return renderBanner(args)
end
end


return p
return p
Anonymous user