mirror of
https://github.com/gwenhael-le-moine/credger.git
synced 2024-12-26 09:58:36 +01:00
red/green total in tooltip
This commit is contained in:
parent
08861e44bc
commit
bbbc714f68
3 changed files with 15 additions and 13 deletions
2
Makefile
2
Makefile
|
@ -14,7 +14,7 @@ pull-deps:
|
|||
cd public/vendor; npm install
|
||||
|
||||
clean:
|
||||
-rm public/js/app.min.js public/js/app.js
|
||||
-rm public/js/app.min.js public/js/app.js credger
|
||||
|
||||
clean-all:
|
||||
-rm -fr lib/ public/vendor/node_modules
|
||||
|
|
|
@ -94,6 +94,8 @@ app.component('dashboard',
|
|||
return series.filter((s) => { return s.value != 0; });
|
||||
};
|
||||
|
||||
let total = e.series.reduce((memo, serie) => { return memo + serie.value; }, 0);
|
||||
|
||||
return `
|
||||
<h2>${e.value}</h2>
|
||||
<table>
|
||||
|
@ -101,10 +103,10 @@ app.component('dashboard',
|
|||
${prepare_series(e.series).map((s) => { return format_line(s); }).join("")}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<tr style="color: #ececec; background-color: ${total < 0 ? 'green' : 'red'}">
|
||||
<td> </td>
|
||||
<td style="text-align: right; text-decoration: underline; font-weight: bold;">Total</td>
|
||||
<td style="text-align: right; font-weight: bold;">${e.series.reduce((memo, serie) => { return memo + serie.value; }, 0)}</td>
|
||||
<td style="text-align: right; font-weight: bold;">${total}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
|
|
@ -2,7 +2,7 @@ version: 1.0
|
|||
shards:
|
||||
kemal:
|
||||
github: kemalcr/kemal
|
||||
commit: 8cb9770ec3c6cf5897e644229dad8d0b5c360941
|
||||
commit: 50f82f51874babe92cbb808013647a7989d54354
|
||||
|
||||
kilt:
|
||||
github: jeromegn/kilt
|
||||
|
|
Loading…
Reference in a new issue