Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
return assessment link
Tag: Reverted
Add mockup options
Tag: Reverted
Line 86:
end
 
local bubble = function(text, short_text, default_colour, option)
local colour = cfg.pale_colours[short_text] or default_colour
local out = mw.html.create('span')
option = tonumber(option)
:addClass('wpb-header-bubbles')
:css('background', colour)
if option == 1 then
:css('border', '0.075em solid ' .. colour)
out = mw.html.create('span')
:wikitext(text)
:css('margin-left', '0.5em')
:css('font-weight', 'normal')
:css('white-space', 'nowrap')
:css('padding', '0 .3em')
:tag('span')
:css('background-color', default_colour)
:css('border', '1px ' .. default_colour .. ' solid')
:css('border-top-left-radius', '1em')
:css('border-bottom-left-radius', '1em')
:css('padding', '0.2em')
:wikitext('   ')
:done()
:tag('span')
:css('border', '1px ' .. default_colour .. ' solid')
:css('border-top-right-radius', '1em')
:css('border-bottom-right-radius', '1em')
:css('padding', '0.2em 0.5em')
:wikitext(text)
:done()
elseif option == 2 then
out = mw.html.create('span')
:css('margin-left', '0.5em')
:css('font-weight', 'normal')
:css('white-space', 'nowrap')
:css('padding', '0 .3em')
:tag('span')
:css('background-color', default_colour)
:css('border', '1.5px ' .. default_colour .. ' solid')
:css('border-top-left-radius', '1em')
:css('border-bottom-left-radius', '1em')
:css('padding', '0.2em')
:wikitext('   ')
:done()
:tag('span')
:css('border', '1.5px ' .. default_colour .. ' solid')
:css('border-top-right-radius', '1em')
:css('border-bottom-right-radius', '1em')
:css('padding', '0.2em 0.5em')
:wikitext(text)
:done()
elseif option == 3 then
out = mw.html.create('span')
:css('margin-left', '0.5em')
:css('font-weight', 'normal')
:css('white-space', 'nowrap')
:css('padding', '0 .3em')
:tag('span')
:css('background-color', default_colour)
:css('border', '2px ' .. default_colour .. ' solid')
:css('border-top-left-radius', '1em')
:css('border-bottom-left-radius', '1em')
:css('padding', '0.2em')
:wikitext('   ')
:done()
:tag('span')
:css('border', '2px ' .. default_colour .. ' solid')
:css('border-top-right-radius', '1em')
:css('border-bottom-right-radius', '1em')
:css('padding', '0.2em 0.5em')
:wikitext(text)
:done()
else
out = mw.html.create('span')
:addClass('wpb-header-bubbles')
:css('background', colour)
:css('border', '0.075em solid ' .. colour)
:wikitext(text)
end
return tostring(out)
end
Line 326 ⟶ 394:
class .. '‑class',
class,
frame:expandTemplate{ title = 'Class/colour', args = {class} },
args.mockup
)
table.insert(nested_ratings, 1, new_bubble)
Line 362 ⟶ 431:
importance .. '‑' .. importance_name,
importance,
frame:expandTemplate{ title = 'Importance/colour', args = {importance} },
args.mockup
)
table.insert(nested_ratings, new_bubble)