Module:Uses TemplateStyles: Difference between revisions

Content deleted Content added
fix
Make function of category match name -- if CSS pages used by more than one template catch on, this may need to be reverted and the category renamed
Line 74:
end
cats[#cats + 1] = category
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if tsProt =~= nilcurrentProt then tsProt = 0 else tsProt = protLevels[tsProt] end
if tsProt < currentProt then
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
break