Content deleted Content added
Jackmcbarn (talk | contribs) simplify again using Module:Redirect |
Jackmcbarn (talk | contribs) rework to not need rfd/core |
||
Line 2:
local getTargetFromText
local messageBox
local rfdText = "'''The purpose of this redirect is currently being discussed by the Wikipedia community."
.. " The outcome of the discussion may result in a change of this page, or possibly its deletion in accordance with Wikipedia's [[Wikipedia:Deletion policy|deletion policy]].''' <br />"
.. " Please share your thoughts on the matter at '''[[Wikipedia:Redirects for discussion/Log/%s %s %s#%s|this redirect's entry]]''' on the [[Wikipedia:Redirects for discussion|Redirects for discussion]] page.<br />"
.. " '''Click on the link below''' to go to the current destination page.<br /><small>Please notify the good-faith creator and any main contributors of the redirect by placing <code>{{[[Wikipedia:Substitution|subst]]:[[Template:RFDNote|RFDNote]]|%s}} ~~~~</code> on their talk page.</small>"
local function makeRfdNotice(args)
local currentTitle = mw.title.getCurrentTitle()
if not messageBox then
messageBox = require('Module:Message box')
end
return string.format('%s<span id="delete-reason" style="display:none;">%%5B%%5BWikipedia%%3ARedirects+for+discussion%%5D%%5D+debate+closed+as+delete</span>%s',
messageBox.main('mbox', {
type = 'delete',
image = 'none',
text = string.format(rfdText, args.year, args.month, args.day, args[1] or currentTitle.prefixedText, currentTitle.prefixedText)
}),
args.category or string.format('[[Category:Redirects for discussion|%s]]', currentTitle.text)
)
end
-- called if the redirect up for discussion is being transcluded
Line 8 ⟶ 29:
getTargetFromText = require('Module:Redirect').getTargetFromText
end
return frame:getParent():preprocess(mw.title.new(getTargetFromText(frame.args
end
-- called if the redirect up for discussion is being viewed
p[''] = function(frame)
return makeRfdNotice(frame.args
end
|