Module:Article history/config: Difference between revisions

Content deleted Content added
add some more statuses
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
Line 2:
-- Configuration data for [[Module:Article history]]
-------------------------------------------------------------------------------
 
local Category = require('Module:Article history/Category')
 
return {
Line 54 ⟶ 56:
FFA = true
},
categories = {function (actionObj, articleHistoryObj)
local ret = {}
function (actionObj, articleHistoryObj)
local result = actionObj:getResult()
if result == 'demoted' or result == 'merged' then
local status = articleHistoryObj:getStatusId()
local sortKey = articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
if status == 'FA' or status == 'FL' then
sortKey = '#' .. sortKey
end
return 'Wikipedia former featured articles', sortKey
end
ret[#ret + 1] = Category.new(
return 'Wikipedia former featured articles', sortKey
sortKey
)
end
return ret
}
end
},
BP = {
Line 100 ⟶ 105:
FFAC = true
},
categories = {function (actionObj, articleHistoryObj)
local ret = {}
function (actionObj, articleHistoryObj)
if actionObj:getResult() == 'not kept' then
returnret[#ret + 1] = Category.new(
'Wikipedia former brilliant prose',
articleHistoryObj.currentTitle.text
end)
end
return ret
}
end
},
FLC = {
Line 151 ⟶ 159:
FFL = true
},
categories = {function (actionObj, articleHistoryObj)
local ret = {}
function (actionObj, articleHistoryObj)
local result = actionObj:getResult()
if result == 'demoted' or result == 'merged' then
local sortKey
if articleHistoryObj:getStatusId() == 'FL' then
sortKey = '#' .. articleHistoryObj.currentTitle.subjectPageTitle.prefixedText
else
sortKey = articleHistoryObj.currentTitle.text
end
return 'Wikipedia former featured lists', sortKey
end
ret[#ret + 1] = Category.new(
return 'Wikipedia former featured lists', sortKey
sortKey
)
end
return ret
}
end
},
FTC = {
Line 275 ⟶ 286:
FFA = true
},
categories = {function (actionObj, articleHistoryObj)
local ret = {}
function (actionObj, articleHistoryObj)
if actionObj:getResult() == 'not listed' then
local status = articleHistoryObj:getStatusId()
if status ~= 'FA'
and status ~= 'GA'
and status ~= 'FFA'
then
returnret[#ret + 1] = Category.new(
'Former good article nominees',
articleHistoryObj.currentTitle.text
end)
end
end
return ret
}
end
},
GAR = {
Line 319 ⟶ 333:
FFA = true
},
categories = {function (actionObj, articleHistoryObj)
local ret = {}
function (actionObj, articleHistoryObj)
if actionObj:getResult() == 'delisted' then
local status = articleHistoryObj:getStatusId()
if status ~= 'FA'
and status ~= 'GA'
then
returnret[#ret + 1] = Category.new(
'Delisted good articles',
articleHistoryObj.currentTitle.text
end)
end
end
}end
},
GTC = {
Line 876 ⟶ 892:
return string.format(text, articlePage, link, display)
end,
categories = function (actionObj, articleHistoryObj)
local ret = {}
functionlocal (actionObj,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')
function local (actionObj,topic = 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(
topic .. ' good articles',
title.text
)
else
ret[#ret + 1] = Category.new(
'Good articles without topic parameter',
title.text
)
end
end
return ret
end
},
FGAN = {