Module:RfD: Difference between revisions

Content deleted Content added
add fix for for one redirects to categories are nominated as that creates a lint error (see Wikipedia:NOREFLIST)
NOINDEX only if actually displaying the RfD notice
 
(10 intermediate revisions by 7 users not shown)
Line 8:
local mboxText = "'''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|Redirectsredirects 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>&#123;&#123;[[Wikipedia:Substitution|subst]]:[[Template:Rfd notice|Rfd notice]]&#124;%s&#125;&#125; &#126;&#126;&#126;&#126;</code> on their talk page.</small>__EXPECTUNUSEDTEMPLATE__"
local deleteReason = '[[Wikipedia:Redirects for discussion]] debate closed as delete'
local messageOnTransclusionsStandard = '&lsaquo;The template below is included via a redirect'
Line 33:
},
['tiny'] = {
['tags'] = {' <span ', '</span> '},
['style'] = '',
['message'] = messageOnTransclusionsTiny:format(args.year, args.month, args.day, discussionPage)
},
}
local size = sizeAttrs[args.showontransclusion] and args.showontransclusion or 'standard'
Line 43:
local classes = 'class="boilerplate metadata plainlinks ' .. visibility .. '" '
local id = 'id="rfd-t" '
local style = 'style="backgroundfont-colorsize: transparent85%; paddingtext-align: 0left;' font-.. sizeAttrs[size:]['style'] xx-small;.. color:'" #000000;'
.. 'text-align: left;' .. sizeAttrs[size]['style'] .. '" '
return tags[1] .. classes .. id .. style .. '>' .. sizeAttrs[size]['message'] .. tags[2]
end
Line 71 ⟶ 70:
category = string.format('[[Category:Redirects for discussion|%s]][[Category:All redirects for discussion|%s]]', currentTitle.text, currentTitle.text)
end
if category then category = category..'[[Category:Temporary maintenance holdings/RFD]]' end
local noindex = mw.getCurrentFrame():expandTemplate{title="NOINDEX"}
return string.format('%s%s<span id="delete-reason" style="display: none;">%s</span>%s%s',
noindex,
messageBox.main('mbox', {
type = 'delete',
Line 102 ⟶ 103:
-- Since we don't have grandparent access, though, it means the thing we're calling doesn't either, so it doesn't really matter yet
local parsedTarget = pframe:expandTemplate{title = ':' .. target.prefixedText, args = pframe.args}
iflocal showontransclusion = frame.args.showontransclusion and not mw.isSubsting() then
showontransclusion = require('Module:Yesno')(showontransclusion, showontransclusion)
if showontransclusion and not (showontransclusion == '' or mw.isSubsting()) then
return makeTransclusionTag(args, redirect) .. parsedTarget
else
return parsedTarget
end
return parsedTarget
end
end
Line 125 ⟶ 127:
text = "'''This title is currently a redirect ''' to [[" .. target .. "]]; click there to go to the current target. The full content of this redirect page, including all [[Wikipedia:Categorizing redirects|redirect categories]], is displayed below."
})
mw.log(target)
else
redirbox = messageBox.main('mbox', {
Line 139 ⟶ 140:
 
local substText = "{{<includeonly>safesubst:</includeonly>#invoke:RfD||%s%s|%s%s\n"
.. "<!-- The above content is generated by {{subst:rfdRfd}}. -->\n<!-- End of RFD message. Don't edit anything above here. Feel free to edit below here, but do NOT change the redirect's target. -->|content=\n%s\n"
.. "<!-- Don't add anything after this line unless you're drafting a disambiguation page or article to replace the redirect. -->\n}}"
local dateText = 'month = %B\n|day = %e\n|year = %Y\n|time = %R\n|timestamp = %Y%m%d%H%M%S'
Line 145 ⟶ 146:
-- called during subst when the template is initially placed on the page
function p.main(frame)
local titleText
local pframe = frame:getParent()
local pargs = pframe.args