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