Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
add class assess
fix
Line 339:
local importance = importance_mask(raw_args.importance or raw_args.priority, class, args.IMPORTANCE_SCALE, banner_name)
local importance_name = args.IMPN or (raw_args.priority and 'priority' or cfg.importance.default_name)
if importance then
local category = (importance=='' and 'Unknown' or importance) .. '-' .. importance_name .. ' ' .. assessment_cat
if importance and importance~='NA' then -- display importance rating
local rating = importance=='Unknown' and cfg.importance.not_yet or cfg.importance.rated:format(importance, importance_name)
local scale_name = cfg.importance.scale:format(importance_name)
local scale = assessment_link
and cfg.importance.project_scale:format(assessment_link..'#'..lang:ucfirst(scale_name), scale_name)
or cfg.importance.default_scale
local importance_rating = cfg.importance.rating:format(pagetype, rating, scale)
local colour = cfg.importance.colour[importance] or cfg.importance.colour.default
local importance_row = mw.html.create('tr')
:tag('td')
:addClass('assess'):addClass('import'):addClass('import-' .. importance)
:css('background', colour):wikitext(wikilink(':Category:' .. category, importance=='Unknown' and '???' or importance))
:done()
:tag('td'):addClass('mbox-text'):attr('colspan', '2'):wikitext(importance_rating)
:allDone()
table.insert(rows, importance_row)
if importance~='Unknown' then -- importance is not NA or Unknown
table.insert(
nested_ratings,
bubble(importance..'‑'..importance_name, colour)
)
end
end
end
if importance then --add importance category
add_category(category)
end