From 9868128558bed0a1767b2b2880bb53e0e7d10154 Mon Sep 17 00:00:00 2001 From: Benedict Börger Date: Mon, 8 Jul 2019 20:31:49 +0200 Subject: [web_frontend][asset] add risk cateogry in overview --- src/web_frontend/asset.rs | 2 ++ templates/asset.html.tera | 3 +++ 2 files changed, 5 insertions(+) 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 @@ Account Category + Risk Balance @@ -50,6 +51,7 @@ {{ account.name }} {{ account.category }} + {{ account.risk }} {% if account.balance >= 0 %} {{ account.balance | round(method="common", precision=2)}} {% else %} @@ -62,6 +64,7 @@ + {% if amount_sum >= 0 %} {{ amount_sum | round(method="common", precision=2) }} {% else %} -- cgit v1.2.3-70-g09d2