Content deleted Content added
use cfg |
attempt to simplify logic for quality class |
||
Line 91:
:addClass('wpb-header-bubbles')
:css('background', colour)
:css('border', conflict
:wikitext(text)
return tostring(out)
Line 226:
assessment_link = nil
end
local class_mask = require('Module:Class mask' .. (sandbox or ''))._main
local check_exists = function(class, assessment_cat) -- check if category exists and is not blank
Line 235 ⟶ 236:
end
end
local class = raw_args.class
local custom_mask = banner_name:subPageTitle('class')▼
if custom_mask.exists and #custom_mask:getContent()>1 then▼
class = mw.text.trim(frame:expandTemplate{▼
title = custom_mask.prefixedText,▼
args = raw_args▼
})▼
end▼
else▼
class = class_mask(classmask_args, current_title)▼
local show_quality = true▼
if class then -- banner gives quality ratings
▲ local show_quality, conflict = true, false
if args.QUALITY_CRITERIA
▲ class = mw.text.trim(frame:expandTemplate{
▲ title = custom_mask.prefixedText,
▲ args = raw_args
▲ })
▲ else
local classmask_args = {FQS = 'yes', [1] = raw_args.class}
local article_class = p.readarticleclass({ignore_subtemplates=true}, current_title.prefixedText)
article_class = article_class and class_mask({article_class}, current_title)
Line 273 ⟶ 266:
show_quality = false
else -- article class exists and differs from local class
add_category('Articles with conflicting quality ratings')
end
Line 307 ⟶ 300:
class,
frame:expandTemplate{ title = 'Class/colour', args = {class} },
)
table.insert(nested_ratings, 1, new_bubble)
|