Content deleted Content added
Jackmcbarn (talk | contribs) use expandTemplate instead of crudely reimplementing it |
Jackmcbarn (talk | contribs) add error message when there's an error, instead of just a category |
||
Line 6:
local messageBox
local mboxText = "%s'''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 errorMessage = '<span class="error">Error: Unable to determine the redirect\'s target. If this page is a soft redirect, then this error can be ignored. Otherwise, please make sure that [[WP:RFD#HOWTO|the instructions for placing this tag]] were followed correctly, in particular that the redirect\'s old content was passed in the <code>content</code> parameter.</span><br />'
local deleteReason = '[[Wikipedia:Redirects for discussion]] debate closed as delete'
Line 23 ⟶ 24:
end
local target = getTargetFromText(args.content)
local isError = not target or not mw.title.new(target)
return string.format('%s<span id="delete-reason" style="display:none;">%s</span>%s%s',
messageBox.main('mbox', {
type = 'delete',
image = 'none',
text = string.format(mboxText, isError and errorMessage or '', args.year, args.month, args.day, discussionPage or currentTitle.prefixedText, currentTitle.prefixedText)
}),
mw.uri.encode(deleteReason),
args.category or string.format('[[Category:Redirects for discussion|%s]]', currentTitle.text),
)
end
|