Open main menu

Changes

Module:Authority control

177 bytes added, 08:01, 23 July 2018
+Pencil icon next to Authority control on LHS via {{EditAtWikidata}} (500k transclusions currently), to standardize the navigational display between WP & WD instead of reinventing the wheel, per VPP discussion (uses QID= in testcases); move getContentLanguage() out from loop; WL all mainspace-named cats when outside of mainspace (by definition)
'! Faulty IDs\n' ..
'|-\n'
local lang = mw.getContentLanguage()
for _, conf in pairs( p.conf ) do
local param, link, pid = conf[1], conf[2], conf[3]
local miscCat = 'Miscellaneous pages with '..param..' identifiers'
local faultyCat = 'Wikipedia articles with faulty authority control identifiers ('..param..')'
local lang = mw.getContentLanguage()
local articleCount = lang:formatNum( mw.site.stats.pagesInCategory(articleCat, 'pages') )
local userCount = lang:formatNum( mw.site.stats.pagesInCategory(userCat, 'pages') )
local outString = ''
if #elements > 0 then
local args = {}
if testcases and itemId then args = { qid = itemId } end --expensive
local pencil = frame:expandTemplate{ title = 'EditAtWikidata', args = args}
outString = Navbox._navbox( {
name = 'Authority control',
bodyclass = 'hlist',
group1 = '[[Help:Authority control|Authority control]]'.. pencil,
list1 = table.concat( elements )
} )
auxCats = mw.ustring.gsub(auxCats, '(%[%[)(Category)', '%1:%2') --for easier checking
end
outString = outString .. auxCats
if namespace ~= 0 then
outString = mw.ustring.gsub(outString, '(%[%[)(Category:Wikipedia articles)', '%1:%2') --by definition
end
outString = outString .. auxCats
end
Anonymous user