Module:Uses TemplateStyles: Difference between revisions

Content deleted Content added
Adding category for pages using CSS without protection template
Fixing logic
Line 82:
end
cats[#cats + 1] = category
if not yesno(args.noprotcat) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
return ""
local addedLevelCat = false
end
local addedPadlockCat = truefalse
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
for i, ts in ipairs(tStyles) do
local addedLevelCat = false
local addedPadlockCattsTitleObj = falsemw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
for i, ts in ipairs(tStyles) do
if tsProt ~= currentProt and not addedLevelCat then
local tsTitleObj = mw.title.new(ts)
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
end
if tsProt ~= currentProt and not addedLevelCat then
if tsProt and not addedPadlockCat then
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
local content = tsTitleObj:getContent()
end
if tsProt and not addedPadlockCatcontent:find("{{pp-") then
cats[#cats + 1] = "Templates using TemplateStyles without padlocks"
local content = tsTitleObj:getContent()
addedPadlockCat = true
if not content:find("{{pp-") then
end
cats[#cats + 1] = "Templates using TemplateStyles without padlocks"
addedPadlockCat = true
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)