Content deleted Content added
fix DGA name |
put class config in the order of the classes in the main module |
||
Line 34:
-- CONFIG TABLE START
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Statuses
-- Configuration for possible current statuses of the article.
-------------------------------------------------------------------------------
-- The statuses table contains valid statuses.
-- Each status can have the following fields:
--
-- id: the main ID for the status.
-- aliases: a table of ID aliases that can be used to access the config table.
-- icon: The status icon.
-- iconSize: The icon size, including "px" suffix. The default is defined in
-- defaultStatusIconSize.
-- iconSmallSize: The icon size if we are outputting a small template. The
-- default is defined in defaultSmallStatusIconSize.
-- iconMultiSize: The icon size if we are outputting multiple status rows. The
-- default is defaultSmallStatusIconSize.
-- text: The status text. This may be a string or a function. If it is a
-- function, it takes an article history object as input, and should return
-- the text string. If it is a string, it can have the following parameters:
-- $1 - The full page name of the article or subject page
-- $2 - The page name without the namespace name
-- categories: An array of categories used by the status.
statuses = {
FA = {
id = 'FA',
name = 'Featured article',
icon = 'Featured article star.svg',
text = function (articleHistoryObj)
local articlePage = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
local actions = articleHistoryObj:getActionObjects()
local link
for i = #actions, 1, -1 do
local actionObj = actions[i]
if actionObj.id == 'FAC' then
link = actionObj.link
break
end
end
link = link or 'Wikipedia:Featured article candidates/' .. articlePage
local text = "'''%s''' is a [[Wikipedia:Featured articles|featured article]]; " ..
"it (or a previous version of it) has been '''''[[%s|identified]]''''' " ..
"as one of the best articles produced by the [[Wikipedia:Wikipedians|Wikipedia community]]. " ..
"Even so, if you can update or improve it, [[Wikipedia:Be bold|please do so]]."
return string.format(text, articlePage, link)
end,
categories = {'Wikipedia featured articles'}
},
FFA = {
id = 'FFA',
name = 'Former featured article',
icon = 'Featured article star - cross.svg',
iconSize = '48px',
text = "'''$1''' is a [[Wikipedia:Former featured articles|former featured article]]. " ..
"Please see the links under Article milestones below for its original nomination page " ..
"(for older articles, check [[Wikipedia:Featured article candidates/Archived nominations/Index|the nomination archive]]) " ..
"and why it was removed.",
categories = {'Wikipedia former featured articles'}
},
FFAC = {
id = 'FFAC',
name = 'Former featured article candidate',
aliases = {'FACFAILED'},
icon = 'Cscr-former.svg',
text = "'''$1''' is a former [[Wikipedia:Featured article candidates|featured article candidate]]. " ..
"Please view the links under Article milestones below to see why " ..
"the nomination failed. For older candidates, please check the " ..
"[[Wikipedia:Featured article candidates/Archived nominations/Index|archive]]."
},
FL = {
id = 'FL',
name = 'Featured list',
icon = 'Featured article star.svg',
iconSize = '48px',
text = function (articleHistoryObj)
local articlePage = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
local actions = articleHistoryObj:getActionObjects()
local link
for i = #actions, 1, -1 do
local actionObj = actions[i]
if actionObj.id == 'FLC' then
link = actionObj.link
break
end
end
link = link or 'Wikipedia:Featured list candidates/' .. articlePage
local text = "'''%s''' is a [[Wikipedia:Featured lists|featured list]], " ..
"which means it has been '''''[[%s|identified]]''''' as one of the best " ..
"[[Wikipedia:Lists|lists]] produced by the [[Wikipedia:Wikipedians|Wikipedia community]]. " ..
"If you can update or improve it, [[Wikipedia:Be bold|please do so]]."
return string.format(text, articlePage, link)
end,
categories = {'Wikipedia featured lists'}
},
FFL = {
id = 'FFL',
name = 'Former featured list',
icon = 'Cscr-featured-strike.svg',
text = "'''$1''' is a [[Wikipedia:Former featured lists|former featured list]]. " ..
"Please see the links under Article milestones below for its original " ..
"nomination page and why it was removed. If it has improved again to " ..
"[[Wikipedia:Featured list criteria|featured list standard]], you may " ..
"[[Wikipedia:Featured list candidates|renominate]] the article to " ..
"become a [[Wikipedia:Featured list|featured list]]."
},
FFLC = {
id = 'FFLC',
name = 'Former featured list candidate',
icon = 'Cscr-former.svg',
iconCaption = 'Former FLC',
text = "'''$1''' is a former [[Wikipedia:Featured list candidates|featured list candidate]]. " ..
"Please view the link under Article milestones below to see why the nomination failed. " ..
"Once the objections have been addressed you may " ..
"[[Wikipedia:Featured list candidates#Resubmitting nominations|resubmit]] " ..
"the article for featured list status.",
categories = {'Wikipedia featured list candidates (contested)'}
},
['FFA/GA'] = {
id = 'FFA/GA',
name = 'Former featured article, current good article',
isMulti = true,
statuses = {'FFA', 'GA'}
},
GA = {
id = 'GA',
name = 'Good article',
icon = 'Symbol support vote.svg',
iconSize = '40px',
iconMultiSize = '25px',
text = function (articleHistoryObj)
local link, display = getGoodArticleTopicLink(articleHistoryObj.args.topic)
local articlePage = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
local text = "'''%s''' has been listed as one of the '''''[[%s|%s]]''''' " ..
"under the [[Wikipedia:Good article criteria|good article criteria]]. " ..
"If you can improve it further, [[Wikipedia:Be bold|please do so]]. " ..
"<small>''If it no longer meets these criteria, you can " ..
"'''[[Wikipedia:Good article reassessment|reassess]]''' it''.</small>"
return string.format(text, articlePage, link, display)
end,
categories = function (articleHistoryObj)
local ret = {}
local title = articleHistoryObj.currentTitle
if title.namespace == 1 then
ret[#ret + 1] = Category.new('Wikipedia good articles')
ret[#ret + 1] = Category.new('Wikipedia CD Selection-GAs')
ret[#ret + 1] = Category.new('GA-Class Good articles')
local topic = getGoodArticleTopic(articleHistoryObj.args.topic)
if topic then
ret[#ret + 1] = Category.new(
topic .. ' good articles',
title.text
)
else
ret[#ret + 1] = Category.new(
'Good articles without topic parameter',
title.text
)
end
end
return ret
end
},
FGAN = {
id = 'FGAN',
name = 'Former good article nominee',
aliases = {'FAILEDGA'},
icon = 'Symbol unsupport vote.svg',
text = function (articleHistoryObj)
local articlePage = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
local link, display = getGoodArticleTopicLink(articleHistoryObj.args.topic)
local text = "'''%s''' was a '''''[[%s|%s]]''''' nominee, " ..
"but did not meet the [[Wikipedia:Good article criteria|good article criteria]] " ..
"at the time. There are suggestions below for improving the article. " ..
"Once these issues have been addressed, the article can be " ..
"[[Wikipedia:Good article nominations|renominated]]. " ..
"Editors may also seek a '''[[Wikipedia:Good article reassessment|reassessment]]''' " ..
"of the decision if they believe there was a mistake."
return string.format(text, articlePage, link, display)
end,
categories = {'Former good article nominees'}
},
DGA = {
id = 'DGA',
name = 'Delisted good article',
aliases = {'DELISTEDGA'},
icon = 'Symbol unsupport vote.svg',
iconCaption = 'Former good article',
text = function (articleHistoryObj)
local articlePage = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
local link, display = getGoodArticleTopicLink(articleHistoryObj.args.topic)
local text = "'''%s''' was one of the '''''[[%s|%s]]''''', " ..
"but it has been removed from the list. " ..
"There are suggestions below for improving the article to meet the " ..
"[[Wikipedia:Good article criteria|good article criteria]]. " ..
"Once these issues have been addressed, the article can be " ..
"[[Wikipedia:Good article nominations|renominated]]. " ..
"Editors may also seek a '''[[Wikipedia:Good article reassessment|reassessment]]''' " ..
"of the decision if they believe there was a mistake."
return string.format(text, articlePage, link, display)
end,
categories = {'Delisted good articles'}
},
FFT = {
id = 'FFT',
name = 'Part of former featured topic',
icon = 'Cscr-featured-strike.svg',
iconCaption = 'Former featured topic',
text = "This article is part of a " ..
"''[[Wikipedia:Former featured topics|former featured topic]]'' series. " ..
"If it has improved again to " ..
"[[Wikipedia:Featured topic criteria|featured topic standard]], " ..
"you may [[Wikipedia:Featured topic candidates|renominate]] " ..
"the topic to become a [[Wikipedia:Featured topic|featured topic]]."
},
FFTC = {
id = 'FFTC',
name = 'Former featured topic candidate',
icon = 'Cscr-former.svg',
text = "This article is part of a ''former'' " ..
"[[Wikipedia:Featured topic candidates|featured topic candidate]]. " ..
"Please view the links under Article milestones below to see why " ..
"the nomination failed."
},
FPO = {
id = 'FPO',
name = 'Featured portal',
icon = 'Cscr-former.svg',
text = "The '''$2 Portal''' is a [[Wikipedia:Featured portals|featured portal]], " ..
"which means it has been " ..
"'''''[[Wikipedia:Featured portal candidates/Portal:$2|identified]]''''' " ..
"as one of the best portals on [[Wikipedia]]. " ..
"If you see a way this portal can be updated or improved without " ..
"compromising previous work, please feel free to contribute.",
categories = function (articleHistoryObj)
return {Category.new(
'Wikipedia featured portals',
articleHistoryObj.currentTitle.text
)}
end
},
FFPO = {
id = 'FFPO',
name = 'Former featured portal',
icon = 'Featured article star - cross.svg',
text = "This portal is a [[Wikipedia:Former featured portals|former featured portal]]. " ..
"Please see the links under Portal milestones below for its " ..
"original nomination page and why it was removed.",
categories = function (articleHistoryObj)
return {Category.new(
'Wikipedia former featured portals',
articleHistoryObj.currentTitle.text
)}
end
},
FFPOC = {
id = 'FFPOC',
name = 'Former featured portal candidate',
icon = 'Cscr-former.svg',
text = "This portal is a '''''former''''' " ..
"[[Wikipedia:Featured portal candidates|featured portal candidate]]. " ..
"Please see the links under Portal milestones below for its " ..
"original nomination page and why the nomination failed.",
categories = function (articleHistoryObj)
return {Category.new(
'Wikipedia featured portal candidates (contested)',
articleHistoryObj.currentTitle.text
)}
end
},
PR = {
-- Peer review is a valid current status, but it doesn't trigger a
-- header row.
id = 'PR',
name = 'Peer reviewed'
}
},
-- The following are statuses that
nullStatuses = {
PR = true
},
invalidStatuses = {
FAC = {
id = 'FAC'
},
FAR = {
id = 'FAR'
},
STUB = {
id = 'STUB',
aliases = {'START', 'B', 'A'}
},
NA = {
id = 'NA',
aliases = {'PR', ''}
},
},
getStatusIdFunction = function (articleHistoryObj)
-- Get the status ID. The status code is the code passed in from the
-- arguments, and the ID is the value contained in the config.
local statuses = articleHistoryObj.cfg.statuses
local statusCode = articleHistoryObj.args.currentstatus
local statusId = articleHistoryObj:getStatusIdForCode(statusCode)
-- Check for former featured articles.
if statusId ~= 'FA'
and statusId ~= 'FL'
and statusId ~= 'FFA'
and statusId ~= 'FFL'
and statusId ~= 'FFA/GA'
then
local ffaObj
local actions = articleHistoryObj:getActionObjects()
for i = #actions, 1, -1 do
local actionObj = actions[i]
if actionObj.id == 'FAR' and actionObj.resultId == 'demoted' then
ffaObj = actionObj
break
end
end
if ffaObj then
if not statusId then
-- @TODO: Error
elseif statusId == 'GA' then
statusId = 'FFA/GA'
elseif statusId ~= 'FFA' then
-- @TODO: Error -
end
end
end
return statusId
end,
-------------------------------------------------------------------------------
-- Notices
-------------------------------------------------------------------------------
notices = {
{
param = 'ftname'
}
},
-------------------------------------------------------------------------------
Line 782 ⟶ 1,129:
},
validStatuses = false
}
},
|