Changes

Padlocks will never be added to TemplateStyles pages. They work only on wikitext pages.
Line 46: Line 46:  
boxArgs.text = 'This ' ..  
 
boxArgs.text = 'This ' ..  
 
(mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..
 
(mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..
' uses [[Wikipedia:TemplateStyles|TemplateStyles]]:\n' .. tStylesList
+
' uses [[mw:Help:TemplateStyles|TemplateStyles]]:\n' .. tStylesList
 
end
 
end
 
boxArgs.type = 'notice'
 
boxArgs.type = 'notice'
Line 85: Line 85:  
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 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)
Line 91: Line 90:  
if tsProt ~= currentProt and not addedLevelCat 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"
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