Module:Uses TemplateStyles: Difference between revisions

Content deleted Content added
No edit summary
Adding category for pages using CSS without protection template
Line 74:
testcases = true
}
if (titleObj.namespace == 10 or titleObj.namespace == 828)
and not subpageBlacklist[titleObj.subpageText]
then
Line 86:
end
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
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if tsProt ~= currentProt and not addedLevelCat then
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
breakend
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