Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
test, add icon class
sync to live
Line 89:
end
 
local bubble = function(text, shortText, colour, option)
local out
local paleColours = {
option = tonumber(option)
["FA"] = "#BED3FF",
if option==6 then
["FL"] = "#BED3FF",
local paleColours = {
["FAFM"] = "#BED3FF",
["FLA"] = "#BED3FFC0FFFF",
["FMAL"] = "#BED3FFC0FFFF",
["AGA"] = "#C0FFFFC0FFC0",
["ALB"] = "#C0FFFFDFFFBF",
["GABL"] = "#C0FFC0DFFFBF",
["BC"] = "#DFFFBFFFFFBE",
["CCL"] = "#FFFFBE",
["Start"] = "#FFDBBF",
["Stub"] = "#FFC0C0",
["ListSL"] = "#D2C0FFFFC0C0",
["NAList"] = "#f5f5f5D2C0FF",
["Top"] = "#FFBFFF",
["High"] = "#FFCCFF",
["Mid"] = "#FFD9FF",
["Low"] = "#FFE7FF"},
["NA"] = "#F5F5F5"
}
if paleColours[shortText] then
local paleColour = paleColours[shortText]
out = mw.html.create('span')
Line 354 ⟶ 357:
table.insert(rows, class_row)
if class~='' then
local new_bubble = bubble(
if args.mockup == '2' then
class .. '‑class',
local new_bubble = bubble(
class .. '‑class',
frame:expandTemplate{ title = 'Class/colour', args = {class} },
class,
)
'#EEFDFF',
table.insert(nested_ratings, 1, new_bubble)
args.mockup
)
table.insert(nested_ratings, 1, new_bubble)
else
local new_bubble = bubble(
class .. '‑class',
class,
frame:expandTemplate{ title = 'Class/colour', args = {class} },
args.mockup
)
table.insert(nested_ratings, 1, new_bubble)
end
end
end
Line 410 ⟶ 402:
table.insert(rows, importance_row)
if importance~='Unknown' then -- importance is not NA or Unknown
local new_bubble = bubble(
if args.mockup == '2' then
importance .. '‑' .. importance_name,
local new_bubble = bubble(
importance .. '‑' .. importance_name,
frame:expandTemplate{ title = 'Importance/colour', args = {importance} },
importance,
)
'#FFE6FF',
table.insert(nested_ratings, 1, new_bubble)
args.mockup
)
table.insert(nested_ratings, new_bubble)
else
local new_bubble = bubble(
importance .. '‑' .. importance_name,
importance,
frame:expandTemplate{ title = 'Importance/colour', args = {importance} },
args.mockup
)
table.insert(nested_ratings, new_bubble)
end
end
end
Line 673 ⟶ 654:
end
local status_class = (cfg.status[args.PROJECT_STATUS] or cfg.status.default) .. '-wikiproject'
local background = ''
if args.mockup == '4' or args.mockup == '2' or args.mockup =='6' then
background = '#FFFAEF'
elseif args.mockup =='5' then
background = '#FFFFED'
else
background = '#ffffff'
end
local banner = mw.html.create('table')
local banner_rows = banner
Line 688 ⟶ 661:
:tag('tr')
:addClass('wpb-header')
:css('background', background)
:tag('td')
:addClass('wbp-header-icon')
:attr('width', '50px')
:css('text-align', 'center')
Line 708 ⟶ 679:
:addClass('mbox-text wpb-main')
:attr('colspan','2')
:css('background', background)
:tag('table')
for _, row in ipairs(rows) do