Module:Article history/config: Difference between revisions

Content deleted Content added
convert categories functions to use Category.new, and allow the function to output an array of category objects, rather than trying to use an array of functions
add failed and delisted GAs, and use helper functions to get the GA topic and GA topic links
Line 4:
 
local Category = require('Module:Article history/Category')
 
-------------------------------------------------------------------------------
-- Helper functions
-------------------------------------------------------------------------------
 
local function getGoodArticleTopic(key)
if topicnot key then
return nil
end
local mGATopics = return require('Module:Good article topics')._main(topic)
end
 
local function getGoodArticleTopicLink(key)
local topic = getGoodArticleTopic(key)
local link, display
if topic then
link = 'Wikipedia:Good articles/' .. topic
display = topic .. ' good articles'
else
link = 'Wikipedia:Good articles'
display = 'good articles'
end
return link, display
end
 
return {
-------------------------------------------------------------------------------
-- CONFIG TABLE START
-------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------
Line 871 ⟶ 899:
imageCaption = 'Good article',
text = function (articleHistoryObj)
local topiclink, display = getGoodArticleTopicLink(articleHistoryObj.args.topic)
if topic then
local mGATopics = require('Module:Good article topics')
topic = mGATopics._main(topic)
end
local link, display
if topic then
link = 'Wikipedia:Good articles/' .. topic
display = topic .. ' good articles'
else
link = 'Wikipedia:Good articles'
display = 'good articles'
end
local articlePage = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
local text = "'''%s''' has been listed as one of the '''''[[%s|%s]]''''' " ..
Line 899 ⟶ 915:
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
local mGATopics = require('Module:Good article topics')
topic = mGATopics._main(topic)
end
if topic then
ret[#ret + 1] = Category.new(
Line 922 ⟶ 934:
id = 'FGAN',
aliases = {'FAILEDGA'},
image = 'Symbol unsupport vote.svg',
imageCaption = 'Former good article nominee',
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',
aliases = {'DELISTEDGA'},
image = 'Symbol unsupport vote.svg',
imageCaption = '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 = {
Line 1,089 ⟶ 1,130:
 
-------------------------------------------------------------------------------
-- CONFIG TABLE END
-- End config
-------------------------------------------------------------------------------