diff --git a/backend/core/templates/core/base_pdf.html b/backend/core/templates/core/base_pdf.html index 60517e7fb..9ae07a2b2 100644 --- a/backend/core/templates/core/base_pdf.html +++ b/backend/core/templates/core/base_pdf.html @@ -23,6 +23,9 @@ .flex { display: flex; } +.flex-row { + flex-direction: row; +} .table { display: table; } @@ -234,6 +237,9 @@ .ml-3 { margin-left: 0.75rem; } +.ml-13 { + margin-left: 3.25rem; +} .p-1 { padding: 0.25rem; } @@ -267,6 +273,9 @@ .mt-10 { margin-top: 2.5rem; } +.mt-45{ + margin-top: 11.25rem; +} .justify-center { justify-content: center; diff --git a/backend/core/templates/snippets/ra_data.html b/backend/core/templates/snippets/ra_data.html index 4c26c57b3..ad4ae4e97 100644 --- a/backend/core/templates/snippets/ra_data.html +++ b/backend/core/templates/snippets/ra_data.html @@ -3,13 +3,18 @@
-
-
+
+
{% trans "Risk assessment" %}
-
{{ risk_assessment }}
+
{{ risk_assessment }}

    +
  • {% trans "Risk matrix:" %} +
      +
    • {{ risk_assessment.risk_matrix }}
    • +
    +
  • {% trans "Authors:" %}
      {% for author in risk_assessment.authors.all %} @@ -17,18 +22,24 @@ {% endfor %}
  • -
  • {% trans "Status:" %} {% if risk_assessment.is_draft %} - {% trans "Draft" %} {% else %} {% trans "Ready" %} {% endif %} +
  • {% trans "Reviewers:" %} +
      + {% for author in risk_assessment.reviewers.all %} +
    • {{ author }}
    • + {% endfor %} +
    +
  • +
  • {% trans "Status:" %} + {% if risk_assessment.status %} {{risk_assessment.status}} {% else %} -- {% endif %}
  • +
  • {% trans "ETA:" %} {{ risk_assessment.eta|date }}
  • +
  • {% trans "Due date:" %} {{ risk_assessment.due_date|date }}
  • {% trans "Created at:" %} {{ risk_assessment.created_at|date }}
  • {% trans "Updated at:" %} {{ risk_assessment.updated_at|date }}
-
{% trans "Risk matrix:" %}

{{ risk_assessment.risk_matrix }}

-
-
{% trans "Description" %}:
{% if risk_assessment.description %}{{ risk_assessment.description|linebreaksbr }}{% endif %}
@@ -37,12 +48,12 @@
-
{% trans "Risk scenarios" %} ({{ context|length }})
+

{% trans "Associated Risk scenarios" %} ({{ context|length }}):

{% include 'snippets/ri_list_nested.html' %}
-
-
{% trans "Risk matrix view" %}
+
+
{% trans "Risk matrix view" %}

{% trans "Current" %}

@@ -60,10 +71,11 @@

{% trans "Residual" %}

{% include 'snippets/risk_matrix.html' with data=ri_clusters.residual %} {% endif %}
- -
+
+
+ {% include 'snippets/risk_legend.html' %}
diff --git a/backend/core/templates/snippets/ri_list_nested.html b/backend/core/templates/snippets/ri_list_nested.html index f830aa110..6a2e7254b 100644 --- a/backend/core/templates/snippets/ri_list_nested.html +++ b/backend/core/templates/snippets/ri_list_nested.html @@ -1,7 +1,13 @@ {% load i18n %} {% load static tailwind_tags %} - + + +
{% for scenario in scenarios %} - + @@ -45,9 +51,13 @@
{% trans "ID" %} @@ -30,7 +36,7 @@
{{ scenario.rid }} -

- {% if scenario.threat %}{{ scenario.threat }}{% else %}--{% endif %} -

+ {% for threat in scenario.threats.all %} +

+ {{ threat }} +

+ {% empty %} + -- + {% endfor %}

{{ scenario.existing_controls|linebreaksbr }}

diff --git a/backend/core/templates/snippets/risk_legend.html b/backend/core/templates/snippets/risk_legend.html new file mode 100644 index 000000000..bb4ceed62 --- /dev/null +++ b/backend/core/templates/snippets/risk_legend.html @@ -0,0 +1,21 @@ +{% load i18n core_extras %} + +
+

{% trans "Risk levels" %}

+
+ + {% for risk in risk_matrix.parse_json.risk %} + + + + + + {% endfor %} +
+ + {{ risk.name }} + + {{ risk.description|linebreaksbr }} +
+
+
diff --git a/backend/core/templates/snippets/risk_matrix.html b/backend/core/templates/snippets/risk_matrix.html index 9b4614c90..45ed95bc0 100644 --- a/backend/core/templates/snippets/risk_matrix.html +++ b/backend/core/templates/snippets/risk_matrix.html @@ -41,18 +41,18 @@ {% else %}
-
-