Module:Sandbox/SWinxy AfC submission
Appearance
![]() | This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
![]() | This module depends on the following other modules: |
Implements {{AfC submission}}.
Pending
![]() | Review waiting, please be patient.
This may take two months or more, since drafts are reviewed in no particular order. There are 1375 pending submissions waiting for review.
|
Unsubmitted
![]() | Draft article not currently submitted for review.
This is a draft Articles for creation (AfC) submission. It is not currently pending review. While there are no deadlines, abandoned drafts may be deleted after six months. To edit the draft click on the "Edit" tab at the top of the window. To be accepted, a draft should:
|
Declined
Submission declined | ![]() |
Rejected
Submission rejected | ![]() |
Reviewing
![]() | Review in progress. | ![]() |
Usage
{{#invoke:Sandbox/SWinxy AfC submission|main}}
require('strict')
local arguments = require("Module:Arguments")
local messageBox = require("Module:Message box")
local mRedirect = require('Module:Redirect')
-- text
local createdText = "This article, '''$1''', has recently been created via the [[Wikipedia:Articles for creation|Articles for creation process]]. Please check to see if the reviewer has accidentally left this template after accepting the draft and [[Template:AfC_submission/created#What to do if you see this template|take appropriate action]] as necessary."
local reviewingText = "'''Review in progress.'''"
local draftText = "'''Draft article not currently submitted for review.'''\n\nThis is a draft [[Wikipedia:Articles for creation|Articles for creation]] (AfC) submission. It is '''not''' currently pending review. While there are [[Wikipedia:There is no deadline|no deadlines]], abandoned drafts may be deleted after six months. To edit the draft click on the \"Edit\" tab at the top of the window.\n\n----\n\nTo be accepted, a draft should:\n* Show the subject '''[[WP:notability|qualifies for a Wikipedia article]]''' by using multiple sources that meet four criteria. The sources should be (1) [[Wikipedia:Reliable sources|reliable]] (2) [[WP:SECONDARY|secondary]] (3) [[Wikipedia:Identifying and using independent sources|independent of the subject]] (4) talk about the subject in some depth. For some topics, [[WP:SNG|there are alternative criteria]].\n* Be written from a [[WP:Neutral point of view|neutral point of view]]\n* Respect [[Wikipedia:Copyright violations|copyright]], and not [[Wikipedia:Plagiarism|plagiarize]]. Do not copy-paste.\n\nIt is '''[[Wikipedia:Conflict of interest|strongly discouraged]]''' to write about [[Wikipedia:Autobiography|yourself]], [[Wikipedia:FAQ/Organizations|your business or employer]]. If you do so, you '''[[Wikipedia:Conflict of interest#How to disclose a COI|must declare it]]'''."
local rejectedText = "'''Submission rejected'''"
local declinedText = "'''Submission declined'''"
local pendingText = "'''Review waiting, please be patient.'''\n\nThis may take $1, since drafts are reviewed in no particular order. There are $2 pending submissions [[:Category:Pending AfC submissions|waiting for review]].\n\n----\n\n* If the submission is '''accepted''', then this page will be moved into the article space.\n* If the submission is '''declined''', then the reason will be posted here.\n* In the meantime, you can continue to improve this submission by editing normally."
local p = {}
local function pagesInSubcat(subcat)
return mw.site.stats.pagesInCategory("AfC pending submissions by age/" .. subcat, "pages")
end
local function reviewTime()
if pagesInSubcat("Very old") > 0 then
return "more than six months"
elseif pagesInSubcat("5 months ago") > 0 then
return "five months or more"
elseif pagesInSubcat("4 months ago") > 0 then
return "four months or more"
elseif pagesInSubcat("3 months ago") > 0 then
return "three months or more"
elseif pagesInSubcat("2 months ago") > 0 then
return "two months or more"
elseif pagesInSubcat("8 weeks ago") > 0 then
return "eight weeks or more"
elseif pagesInSubcat("7 weeks ago") > 0 then
return "seven weeks or more"
elseif pagesInSubcat("6 weeks ago") > 0 then
return "six weeks or more"
elseif pagesInSubcat("5 weeks ago") > 0 then
return "five weeks or more"
elseif pagesInSubcat("4 weeks ago") > 0 then
return "four weeks or more"
elseif pagesInSubcat("20 days ago") + pagesInSubcat("19 days ago") + pagesInSubcat("18 days ago") + pagesInSubcat("17 days ago") + pagesInSubcat("16 days ago") + pagesInSubcat("15 days ago") > 0 then
return "2–3 weeks or more"
elseif pagesInSubcat("14 days ago") + pagesInSubcat("13 days ago") + pagesInSubcat("12 days ago") + pagesInSubcat("11 days ago") + pagesInSubcat("10 days ago") + pagesInSubcat("9 days ago") > 0 then
return "a week or more"
else
return "up to a week"
end
end
function p._main(args, frame)
local box
local title = mw.title.getCurrentTitle()
if title.namespace == 0 then -- created
box = messageBox.main("ambox", {
name = "AfC submission",
type = "notice",
image = "[[File:AFC-Logo.svg|50px|link=|alt=]]",
text = createdText
})
elseif args[1] == "R" then -- reviewing
box = messageBox.main("ombox", {
name = "AfC submission",
type = "notice",
image = "[[File:AFC-Logo Pending.svg|75px|link=|alt=]]",
imageright = "[[File:Ambox clock.svg|75px|link=|alt=]]",
style = "background-color: #b1dae8;",
textstyle = "CSS values",
text = reviewingText
})
elseif args[1] == "T" then -- draft
box = messageBox.main("ombox", {
type = "notice",
image = "[[File:AFC-Logo Hold.svg|75px|link=|alt=]]",
style = "background-color: #eaebe4;",
textstyle = "CSS values",
text = draftText
})
elseif args[1] == "D" and args["reject"] ~= nil then -- rejected
box = messageBox.main("ombox", {
type = "notice",
image = "none",
imageright = "[[File:Dialog-STOP.svg|60px|link=|alt=]]",
style = "background-color: #FEE;",
text = rejectedText
})
elseif args[1] == "D" then -- delcined
box = messageBox.main("ombox", {
type = "notice",
image = "none",
imageright = "[[File:AFC-Logo_Decline.svg|75px|link=|alt=]]",
style = "background-color: #FEE",
text = declinedText
})
else -- "pending"
box = messageBox.main("ombox", {
type = "notice",
image = "[[File:AFC-Logo.svg|75px|link=|alt=]]",
style = "background-color: #f3eba3;",
text = mw.ustring.gsub(mw.ustring.gsub(pendingText, "$1", reviewTime()), "$2", mw.site.stats.pagesInCategory("Pending AfC submissions", "pages") - 3)
})
end
return box
end
function p.main(frame)
local args = arguments.getArgs(frame)
return p._main(args, frame)
end
return p