From 6f98cbb361656190c5f79a40d43e2e27d3befc48 Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Wed, 31 Jul 2024 13:40:06 +0000 Subject: [PATCH 1/2] Show risk for each question in the Risk profile --- framework/python/src/common/risk_profile.py | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/framework/python/src/common/risk_profile.py b/framework/python/src/common/risk_profile.py index 6afb229ac..cbfc0618b 100644 --- a/framework/python/src/common/risk_profile.py +++ b/framework/python/src/common/risk_profile.py @@ -409,6 +409,14 @@ def _generate_risk_questions(self): content += '' + # Question risk label + if 'risk' in question: + if question['risk'] == 'High': + content += '
HIGH RISK
' + elif question['risk'] == 'Limited': + content += '''
+ LIMITED RISK
''' + content += '''''' index += 1 @@ -635,6 +643,33 @@ def _generate_css(self): ul { margin-top: 0; } + + .risk-label{ + position: absolute; + top: 1px; + right: 0px; + width: 52px; + height: 16px; + font-family: 'Google Sans', sans-serif; + font-size: 8px; + font-weight: 500; + line-height: 16px; + letter-spacing: 0.64px; + text-align: center; + font-weight: bold; + border-radius: 3px; + } + + .risk-label-high{ + background-color: #FCE8E6; + color: #C5221F; + } + + .risk-label-limited{ + width: 65px; + background-color:#E4F7FB; + color: #007B83; + } ''' def to_pdf(self, device): From 11b2f6a47c6b19bb5e1876950ff672a74d457ed1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Thu, 1 Aug 2024 10:02:44 +0000 Subject: [PATCH 2/2] set top position to 0 --- framework/python/src/common/risk_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/python/src/common/risk_profile.py b/framework/python/src/common/risk_profile.py index cbfc0618b..8fba41313 100644 --- a/framework/python/src/common/risk_profile.py +++ b/framework/python/src/common/risk_profile.py @@ -646,7 +646,7 @@ def _generate_css(self): .risk-label{ position: absolute; - top: 1px; + top: 0px; right: 0px; width: 52px; height: 16px;