Module:Article history: Difference between revisions

Content deleted Content added
move FFA detection to the config, and make some progress on ArticleHistory:getStatusObj
use a different scheme for making categories
Line 142:
-- Define object structure
obj.actions = {}
obj.categories = {}
-- Format the config
Line 245 ⟶ 244:
 
function ArticleHistory:renderBox()
end
 
function ArticleHistory:addCategory(category, sortKey)
if category then
table.insert(self.categories, {category = category, sortKey = sortKey})
end
end
 
Line 256 ⟶ 249:
local ret = {}
local categoryNsText = mw.site.namespaces[14].name
 
for _, t in ipairs(self.categories) do
local function makeCategory(cat, sortKey)
if t.sortKey then
cat =return string.format('[[%s:%s|%s]]', categoryNsText, cat, sortKey)
'[[%s:%s|%s]]',
categoryNsText, t.category, t.sortKey
)
else
cat =return string.format('[[%s:%s]]', categoryNsText, categorycat)
end
table.insert(ret, cat)
end
 
for _, tactionObj in ipairs(self.categoriesactions) do
ret[#ret + 1] = makeCategory(actionObj:getCategory())
end
 
return table.concat(ret)
end