Fix link rendering in stackedProgressBars

This commit is contained in:
Alfredo Cardigliano 2020-02-16 11:19:19 +01:00
parent da6f1c354d
commit 7c90b3b79b
2 changed files with 11 additions and 5 deletions

View file

@ -206,9 +206,13 @@ function stackedProgressBars(total, bars, other_label, formatter, css_class)
cumulative_perc = cumulative_perc + percentage
if bar.class == nil then bar.class = "primary" end
if bar.style == nil then bar.style = "" end
if bar.link ~= nil then res[#res + 1] = [[<a href="]] .. bar.link .. [[">]] end
res[#res + 1] = [[
<div class="progress-bar bg-]] .. (bar.class) .. [[" role="progressbar" style="width:]] .. percentage .. [[%;]] .. bar.style .. [["></div></a>]]
if bar.link ~= nil then
res[#res + 1] = [[<a href="]] .. bar.link .. [[" style="width:]] .. percentage .. [[%;]] .. bar.style .. [[">
<div class="progress-bar bg-]] .. (bar.class) .. [[" role="progressbar" style="width: 100%"></div></a>]]
else
res[#res + 1] = [[
<div class="progress-bar bg-]] .. (bar.class) .. [[" role="progressbar" style="width:]] .. percentage .. [[%;]] .. bar.style .. [["></div></a>]]
end
if bar.link ~= nil then res[#res + 1] = [[</a>]] end
end