Module:Progression rainbow: Difference between revisions

Content deleted Content added
poke
poke
Line 28:
end
 
local function category_count(classcategory, project, frame)
return tonumber(frame:callParserFunction(
'PAGESINCATEGORY',
classcategory .. project .. 'articles',
'R'
))
Line 56:
local classes = {
{count = 0, class = 'List', category = 'List-Class'},
{count = 0, class = 'Stub', category = 'Stub-Class'},
{count = 0, class = 'Start', category = 'Start-Class'},
{count = 0, class = 'C', category = 'C-Class'},
{count = 0, class = 'B', category = 'B-Class'},
{count = 0, class = 'GA', category = 'GA-Class'},
{count = 0, class = 'A', category = 'A-Class'},
{count = 0, class = 'FA', category = 'FA-Class'}
}
local project_classes = {
{count = 0, class = 'FL', category = 'FL-Class'},
{count = 0, class = 'Unassessed', category = 'Unassessed'}
}
Line 75:
for i, class in pairs(classes) do
if project then
class[1'count'] = category_count(class[3'category'], project, frame)
if class[2'class'] == 'FA' then
class[1'count'] = class[1'count'] + category_count(
project_classes[1][3'category'],
project,
frame
Line 84:
end
elseif args[i] then
class[1'count'] = tonumber(args[i])
end
sum_classes = sum_classes + class[1'count']
end
 
Line 92:
if project then
divisor = sum_classes + category_count(
project_classes[2][3'category'],
project,
frame
Line 105:
 
for i, class in pairs(classes) do
if class[1'count'] ~= 0 then
local percentage = class_percent(class[1'count'], divisor)
root:newline()
:tag('td')
:css('background', frame:expandTemplate{
title = 'class/colour', args = { class[2'class'] }}
)
:css('width', percentage)
:tag('span')
:wikitext(percentage .. " " .. class[3'category'])
:done()
:done()