Content deleted Content added
allow specifying custom height |
Override the default A-class color |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 3:
]]
require('
local p = {}
Line 109:
if class.count ~= 0 then
local percentage = percent(class.count, total)
-- The default Start-class color is difficult to distinguish next to
-- the Stub-class color, so we pick a midpoint between Stub and C
if class.class == 'Start' then
root:newline() -- sprinkled through to make the HTML easier to read
root:tag('li')
:css('background', '#ffca66')
:css('color','inherit')
:css('width', percentage)
:attr('title', string.format('%s %s', percentage, class.category))
:tag('span')
:addClass('sr-only')
:wikitext(string.format('%s %s', percentage, class.category))
:done()
:done()
-- The default A-class color is difficult to distinguish next to
-- the GA-class color, so we pick a midpoint between GA and FA
elseif class.class == 'A' then
root:newline() -- sprinkled through to make the HTML easier to read
root:tag('li')
:css('background', '#64e2ff')
:css('color','inherit')
:css('width', percentage)
:attr('title', string.format('%s %s', percentage, class.category))
:tag('span')
:addClass('sr-only')
:wikitext(string.format('%s %s', percentage, class.category))
:done()
:done()
else
root:newline() -- sprinkled through to make the HTML easier to read
root:tag('li')
Line 114 ⟶ 143:
title = 'class/colour', args = { class.class }
})
:css('color','inherit')
:css('width', percentage)
:attr('title', string.format('%s %s', percentage, class.category))
Line 121 ⟶ 151:
:done()
:done()
end
end
end
|