diff options
| author | Benedict Börger <benedict@0xb8000.de> | 2019-07-08 20:31:49 +0200 |
|---|---|---|
| committer | Benedict Börger <benedict@0xb8000.de> | 2019-07-08 20:31:49 +0200 |
| commit | 9868128558bed0a1767b2b2880bb53e0e7d10154 (patch) | |
| tree | 7aa9682f8f98b2c5afa3f63b0cffe1b18f8314a5 | |
| parent | 236a2609eb153ae428b35c9a31eaedf197a5b036 (diff) | |
[web_frontend][asset] add risk cateogry in overview
| -rw-r--r-- | src/web_frontend/asset.rs | 2 | ||||
| -rw-r--r-- | templates/asset.html.tera | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/web_frontend/asset.rs b/src/web_frontend/asset.rs index 58960f9..c32bdf9 100644 --- a/src/web_frontend/asset.rs +++ b/src/web_frontend/asset.rs @@ -14,6 +14,7 @@ pub struct AssetContext { pub struct Account { name : String, category : String, + risk : String, balance : f32 } @@ -30,6 +31,7 @@ pub fn asset_handler() -> rocket_contrib::templates::Template { let tmp = Account { name : account.name.to_string(), category : account.category.to_string(), + risk : account.riskCategory.to_string(), balance : account.get_balance(today) }; acc.push(tmp); diff --git a/templates/asset.html.tera b/templates/asset.html.tera index 75e8e85..c379977 100644 --- a/templates/asset.html.tera +++ b/templates/asset.html.tera @@ -42,6 +42,7 @@ <tr> <th>Account</th> <th>Category</th> + <th>Risk</th> <th>Balance</th> </tr> </thead> @@ -50,6 +51,7 @@ <tr> <td><a href="/transactions/{{ account.name }}">{{ account.name }}</a></td> <td>{{ account.category }}</td> + <td>{{ account.risk }}</td> {% if account.balance >= 0 %} <td class="text-success">{{ account.balance | round(method="common", precision=2)}}</td> {% else %} @@ -62,6 +64,7 @@ <tr style="border-top:2px solid #000000;"> <td></td> <td></td> + <td></td> {% if amount_sum >= 0 %} <td class="text-success">{{ amount_sum | round(method="common", precision=2) }}</td> {% else %} |
