Modul:Uses TemplateStyles: Unterschied zwischen den Versionen

Adding category for pages using CSS without protection template
Keine Bearbeitungszusammenfassung
(Adding category for pages using CSS without protection template)
Zeile 74: Zeile 74:
testcases = true
testcases = true
}
}
if titleObj.namespace == 10  
if (titleObj.namespace == 10 or titleObj.namespace == 828)
and not subpageBlacklist[titleObj.subpageText]
and not subpageBlacklist[titleObj.subpageText]
then
then
Zeile 86: Zeile 86:
end
end
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedLevelCat = false
local addedPadlockCat = false
for i, ts in ipairs(tStyles) do
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if tsProt ~= currentProt then
if tsProt ~= currentProt and not addedLevelCat then
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
break
end
if tsProt and not addedPadlockCat then
local content = tsTitleObj:getContent()
if not content:find("{{pp-") then
cats[#cats + 1] = "Templates using TemplateStyles without padlocks"
addedPadlockCat = true
end
end
end
end
end
Anonymer Benutzer