Content deleted Content added
add "gacat" parameter |
add an extraCategories table and add the Four award code to it |
||
Line 1,863:
noticeBarIcon = 'WP1 0 Icon.svg'
}
},
-------------------------------------------------------------------------------
-- Extra categories
-- This table contains categories that don't appear as part of a row. It is an
-- array, and array items can be tables of category names, or functions that
-- take an article history object as a parameter and return a table of
-- category objects.
-------------------------------------------------------------------------------
extraCategories = {
-- Four award
function (articleHistoryObj)
local yesno = require('Module:Yesno')
local ret = {}
local isFour = yesno(articleHistoryObj.args.four)
if isFour then
ret[#ret + 1] = Category.new('Wikipedia four award articles')
elseif isFour == false then
ret[#ret + 1] = Category.new('Wikipedia articles rejected for Four awards')
elseif articleHistoryObj:getStatusId() == 'FA' then
local isPossibleFour, isDYK = false, false
for i, obj in ipairs(articleHistoryObj:getCollapsibleNoticeObjects()) do
if obj.id == 'DYK' then
isDYK = true
break
end
end
if isDYK then
for i, obj in ipairs(articleHistoryObj:getActionObjects()) do
if obj.id == 'GAN' and obj:getResult() == 'successful' then
isPossibleFour = true
break
end
end
end
if isPossibleFour then
ret[#ret + 1] = Category.new('Possible Wikipedia four award articles')
end
end
end
},
|