6,240pages on
this wiki
Add New Page
local p = {}
local yn = require( 'Module:Yesno' )
local err = require( 'Module:Error' )
local reason = mw.loadData( 'Module:Delete/reason' )
function p.delete(frame)
    local args = frame:getParent().args
    local rs = "<br>'''Reason for deletion:''' "
    local ns = frame:preprocess('{{NAMESPACE}}')
    local disc = yn(args.discussion, true) and args.discussion or frame:preprocess('{{TALKPAGENAME}}')
    ns = yn(ns, true) and mw.ustring.lower(ns) or 'article'
    --Categorize the page
    local cat = ""
    if args.categories ~= 'false' then cat = "[[Category:Candidates for Deletion]]"
        if yn(args.quick) then cat = cat .. "[[Category:Candidates for Deletion (Quick)]]" end
    -- Deciede reason for deletion
    if yn(args.reason, true) then reason = frame:preprocess(args.reason)
    elseif yn(args.pre, true) then
        if reason[args.pre] == nil then return err('Invalid Preformatted reason') end
        reason = frame:preprocess(reason[args.pre])
        reason = ''
        rs = ''
    rs = rs .. reason
    -- Create the container
    local box = mw.html.create('div')
                :addClass('boilerplate metadata')
                :attr('id', 'delete')
                :css('background', yn(args.quick) and '#fee' or '#edf1f1')
    --Fill it
    local text
    if yn(args.quick) then
      text = "'''This " .. ns .. " is a candidate for speedy deletion.'''"..
      " A user believes that this page makes a clear violation under the Narutopedia's [[Deletion policy]].<br>"..
      "If you disagree with this, then replace this notice area with <code>{{Delete}}</code>" ..
      " and [["..disc.."|discussion]] on whether it should be deleted may commence."
    else text = "'''This " .. ns .. " is being considered for deletion''' in accordance with the Narutopedia's"..
        " [[Deletion policy]].<br>Please share your thoughts on the matter on the [["..disc.."|discussion page]]"
	-- Hardcoded footer in template as it always remains same
	text = text .. rs .. frame:preprocess(frame.args.footer).. cat
    return box:wikitext(text)
return p
--[[Category:Lua Modules]]

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki