mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-01 01:51:18 +01:00
refactor: show plus signs
This commit is contained in:
@@ -227,7 +227,7 @@ function calculateDeltas(results) {
|
||||
|
||||
function increasePercent(last, now) {
|
||||
const percent = last ? (now - last) / last * 100 : 0;
|
||||
return percent.toFixed(0);
|
||||
return (percent > 0 ? `+` : '') + percent.toFixed(0);
|
||||
}
|
||||
results.yesterday -= results.today;
|
||||
results.dayIncrease = increasePercent(results.yesterday, results.today);
|
||||
|
||||
@@ -20,14 +20,12 @@
|
||||
<tbody class="text-sm text-tabular">
|
||||
{{{ each stats }}}
|
||||
<tr>
|
||||
<td class="fw-bold text-nowrap">
|
||||
|
||||
{{{ if ./href }}}
|
||||
<a href="{./href}">{./name}</a>
|
||||
{{{ else }}}
|
||||
{./name}
|
||||
{{{ end }}}
|
||||
|
||||
<td class="fw-semibold text-nowrap">
|
||||
{{{ if ./href }}}
|
||||
<a href="{./href}">{./name}</a>
|
||||
{{{ else }}}
|
||||
{./name}
|
||||
{{{ end }}}
|
||||
</td>
|
||||
<td class="text-end">{formattedNumber(./yesterday)}</td>
|
||||
<td class="text-end">{formattedNumber(./today)}</td>
|
||||
|
||||
Reference in New Issue
Block a user