Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #1547 Display impact level on project page. #1551

Merged
merged 11 commits into from
Apr 22, 2021
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ GovReady-Q Release Notes
v999 (April XX, 2021)
-------------------------

**UI changes**

* Display system impact level on project page.

[Add changes here]
**Data changes**

* Use statement type `fisma_impact_level` to track impact level of a system.

v0.9.3.3 (April 13, 2021)
-------------------------
Expand Down
8 changes: 8 additions & 0 deletions siteapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,18 @@ def project(request, project):
if approx_compliance_degrees > 358:
approx_compliance_degrees = 358

# Fetch statement defining FISMA impact level if set
impact_level_smts = project.system.root_element.statements_consumed.filter(statement_type="fisma_impact_level")
if len(impact_level_smts) > 0:
impact_level = impact_level_smts[0].body
else:
impact_level = None

# Render.
return render(request, "project.html", {
"is_project_page": True,
"project": project,
"impact_level": impact_level,

"controls_status_count": project.system.controls_status_count,
"poam_status_count": project.system.poam_status_count,
Expand Down
10 changes: 9 additions & 1 deletion templates/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ <h2 class="status">{{ poam_status_count.Open }}</h2> <span class="status-small">
<div class="status-box-invisible">
<h2 class="piechart" style="background-image: conic-gradient(#E1F8E2 {{ approx_compliance_degrees }}deg,
#B2E0B2 0 235deg);"> </h2>
<span class="status-small">{{ percent_compliant_100|floatformat:2 }}% compliance (unassessed)<span>
<span class="status-small">{{ percent_compliant_100|floatformat:2 }}% compliance (unassessed)</span>
<br/>
<span class="status-small">
{% if impact_level %}
mission impact: <b>{{ impact_level|lower }}</b>
{% else %}
mission impact: <b>not categorized</b>
{% endif %}
</span>
</div>
</div>
</div>
Expand Down