diff --git a/backend/core/templates/core/base_pdf.html b/backend/core/templates/core/base_pdf.html index 9ae07a2b2..35a9f2ed0 100644 --- a/backend/core/templates/core/base_pdf.html +++ b/backend/core/templates/core/base_pdf.html @@ -16,8 +16,6 @@ .main { font-family: 'Source Sans Pro', sans-serif; -//font-family: 'Open Sans Condensed', sans-serif; -//font-family: 'Barlow Condensed', sans-serif; } .flex { @@ -32,9 +30,6 @@ .container { width: 100%; } -.w-full { - width: 100%; -} .VL { background-color: rgb(187, 247, 208); @@ -53,7 +48,7 @@ } .bg-gray-50 { - background-color: rgb(255, 255, 255); //switched to white + background-color: rgb(250, 250, 251); } .bg-gray-100 { background-color: rgb(244, 244, 245); @@ -223,10 +218,6 @@ .p-4 { padding: 1rem; } -.px-4 { - padding-left: 1rem; - padding-right: 1rem; -} .py-8 { padding-top: 2rem; padding-bottom: 2rem; @@ -281,9 +272,6 @@ justify-content: center; } -.flex-row { - flex-direction: row; -} .w-12 { width: 2rem; diff --git a/backend/core/templates/snippets/mp_data.html b/backend/core/templates/snippets/mp_data.html index 0306da304..f79441ff0 100644 --- a/backend/core/templates/snippets/mp_data.html +++ b/backend/core/templates/snippets/mp_data.html @@ -1,101 +1,111 @@ {% load i18n %} -
-
-

{% trans "Domain" %}: {{ risk_assessment.project.folder }}

-

/

-

{% trans "Project" %}: {{ risk_assessment.project }}

-

/

-

{% trans "Risk assessment" %}: {{ risk_assessment.name }} - {{ risk_assessment.version }}

+
+ {# Header Section #} +
+
+

{% trans "Domain" %}: {{ risk_assessment.project.folder }}

+ / +

{% trans "Project" %}: {{ risk_assessment.project }}

+ / +

{% trans "Risk assessment" %}: {{ risk_assessment.name }} - {{ risk_assessment.version }}

+
-

{% trans "Associated risk scenarios" %}:

-
- - - - + + {# Risk Scenarios Section #} +

{% trans "Associated risk scenarios" %}

+ +
+
+ {% if not context %} - - - - {% endif %} - {% for scenario in context %} - - - - {% if not scenario.applied_controls.all %} - - - + + + {% else %} - - - - - - - - - - - - - - - - - - - - - - {% endif %} - {% for appliedcontrol in scenario.applied_controls.all %} - - - - - - - - - - - + + + {# Existing Controls Section #} + + + + + + + + {% if scenario.applied_controls.exists %} + {# Additional Measures Section #} + + + + + {# Table Headers #} + + + + + + + + + + + + + {# Applied Controls #} + {% for appliedcontrol in scenario.applied_controls.all %} + + + + + + + + + + + + {% endfor %} {% else %} - bg-green-200 - {% endif %}">{{ appliedcontrol.get_status_display|lower }} - - - {% endfor %} - {% endfor %} - + + + + {% endif %} + {% endfor %} + {% endif %}
{% trans "Risk Scenarios and Controls" %}
- {% trans "Risk risk_assessment seems to be empty. Measure Plan cannot be generated." %} -
-

{{ scenario.ref_id }}: {{ scenario.name }}

- {{ scenario.get_treatment_display|lower}} - -
{% trans "No associated measure" %} -
+ + {% trans "Risk assessment seems to be empty. Measure Plan cannot be generated." %} +
{% trans "Existing controls" %}:
{{ scenario.existing_controls }}
{% trans "Additional measures" %}:
#{% trans "Name" %}{% trans "Description" %}{% trans "Type" %}{% trans "Reference control" %}{% trans "ETA" %}{% trans "Effort" %}{% trans "Cost" %}{% trans "Link" %}{% trans "Status" %}
{{ appliedcontrol.mid }}{{ appliedcontrol.name }}{% if appliedcontrol.description %}{{ appliedcontrol.description|linebreaksbr }}{% endif %}{{ appliedcontrol.get_type_display }}{% if appliedcontrol.reference_control %}{{ appliedcontrol.reference_control }}{% else %}--{% endif %}{% if appliedcontrol.eta %}{{ appliedcontrol.eta }}{% else %}--{%endif%}{% if appliedcontrol.effort %}{{ appliedcontrol.effort }}{% else %}--{%endif%}{% if appliedcontrol.cost %}{{ appliedcontrol.cost }}{% else %}--{%endif%}{% if appliedcontrol.link %}{% else %}--{% endif %} - + +
{{ scenario.ref_id }}: {{ scenario.name }}
+ + {{ scenario.get_treatment_display|lower }} + +
+ {% trans "Existing controls" %}: +
+ {{ scenario.existing_controls|default:"--" }} +
+ {% trans "Additional measures" %}: +
#{% trans "Name" %}{% trans "Description" %}{% trans "Type" %}{% trans "Reference control" %}{% trans "ETA" %}{% trans "Effort" %}{% trans "Cost" %}{% trans "Status" %}
{{ appliedcontrol.mid }}{{ appliedcontrol.name }}{{ appliedcontrol.description|default:"--"|linebreaksbr }}{{ appliedcontrol.get_type_display }}{{ appliedcontrol.reference_control|default:"--" }}{{ appliedcontrol.eta|default:"--" }}{{ appliedcontrol.effort|default:"--" }}{{ appliedcontrol.cost|default:"--" }} + + {{ appliedcontrol.get_status_display|lower }} + +
+ + {% trans "No associated measure" %} +
-
diff --git a/backend/core/templates/snippets/ra_data.html b/backend/core/templates/snippets/ra_data.html index 5f13e534a..eb4d250dc 100644 --- a/backend/core/templates/snippets/ra_data.html +++ b/backend/core/templates/snippets/ra_data.html @@ -1,81 +1,112 @@ {% load i18n %} -
- -
-
-
-
{% trans "Risk assessment" %}
-
{{ risk_assessment.project}}/{{ risk_assessment }}
-
-
-
    -
  • {% trans "Risk matrix:" %} -
      -
    • {{ risk_assessment.risk_matrix }}
    • -
    -
  • -
  • {% trans "Authors:" %} -
      +
      + {# Information Banner #} +
      +
      + {# Left Column - Assessment Details #} +
      +

      {% trans "Risk assessment" %}

      +

      {{ risk_assessment.project }}/{{ risk_assessment }}

      + +
      + {# Risk Matrix #} +
      +

      {% trans "Risk matrix:" %}

      +

      {{ risk_assessment.risk_matrix }}

      +
      + + {# Authors #} +
      +

      {% trans "Authors:" %}

      +
        {% for author in risk_assessment.authors.all %}
      • {{ author }}
      • {% endfor %} -
      - -
    • {% 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 }}
    • -
    +
+
+ + {# Reviewers #} +
+

{% trans "Reviewers:" %}

+
    + {% for author in risk_assessment.reviewers.all %} +
  • {{ author }}
  • + {% endfor %} +
+
+ + {# Status Information #} +
+

+ {% trans "Status:" %} + {{ risk_assessment.status|default:"--" }} +

+

+ {% 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 "Description" %}:
-
{% if risk_assessment.description %}{{ risk_assessment.description|linebreaksbr }}{% endif %}
-
+ {# Right Column - Description #} +
+

{% trans "Description" %}:

+
+ {{ risk_assessment.description|default:""|linebreaksbr }} +
+
- -
-

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

+ + {# Risk Scenarios Section #} +
+

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

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

{% trans "Current" %}

- {% if pdf %} - {% include 'snippets/risk_matrix.html' with enriched_data=ri_clusters.current %} - {% else %} - {% include 'snippets/risk_matrix.html' with data=ri_clusters.current %} - {% endif %} -
-
-

{% trans "Residual" %}

- {% if pdf %} - {% include 'snippets/risk_matrix.html' with enriched_data=ri_clusters.residual %} - {% else %} - {% include 'snippets/risk_matrix.html' with data=ri_clusters.residual %} - {% endif %} -
+ + {# Risk Matrix View Section #} +
+

{% trans "Risk matrix view" %}

+ + {# Current Risk Matrix #} +
+

{% trans "Current" %}

+ {% if pdf %} + {% include 'snippets/risk_matrix.html' with enriched_data=ri_clusters.current %} + {% else %} + {% include 'snippets/risk_matrix.html' with data=ri_clusters.current %} + {% endif %} +
+ + {# Residual Risk Matrix #} +
+

{% trans "Residual" %}

+ {% if pdf %} + {% include 'snippets/risk_matrix.html' with enriched_data=ri_clusters.residual %} + {% else %} + {% include 'snippets/risk_matrix.html' with data=ri_clusters.residual %} + {% endif %}
-
+ {# Risk Legend #} +
{% include 'snippets/risk_legend.html' %}
-
diff --git a/backend/core/templates/snippets/req_node.html b/backend/core/templates/snippets/req_node.html index d90c910fe..5953d0304 100644 --- a/backend/core/templates/snippets/req_node.html +++ b/backend/core/templates/snippets/req_node.html @@ -1,90 +1,111 @@ {% load i18n core_extras %}
- {% if not node.requirement_node.assessable %} -
- {{ node.requirement_node.display_long }} + {% if not node.requirement_node.assessable %} +
{{ node.requirement_node.display_long }}
+ {% if node.bar_graph %} {% bar_graph assessments ancestors + node.requirement_node %} {% endif %} {% else %} +
+
+
{{ node.assessments.requirement }}
+
+
+ {{ node.status }}
- {% if node.bar_graph %} - {% bar_graph assessments ancestors node.requirement_node %} - {% endif %} - {% else %} -
-
-
{{ node.assessments.requirement }}
-
-
{{ node.status }}
-
{{ node.result }}
- {% if node.assessments.is_scored %} -
{{ node.assessments.score }}
- {% endif %} -
-
- {% if node.assessments.requirement.description %} -
{{ node.assessments.requirement.get_description_translated }}
- {% endif %} - {% if node.assessments.answer %} - {% for question in node.assessments.answer.questions %} -

{{ question.text }}

- {% if question.answer %} - {{ question.answer }} - {% else %} - {% trans "No answer" %} - {% endif %} -
- {% endfor %} - {% endif %} - {% if node.assessments.observation %} -

{% trans "Observation:" %}

{{ node.assessments.observation }}

- {% endif %} +
+ {{ node.result }} +
+ {% if node.assessments.is_scored %} +
+ {{ node.assessments.score }}
- {% if node.bar_graph %} - {% bar_graph assessments ancestors node.requirement_node %} - {% endif %} - {% if node.direct_evidences %} -
-
-
{% trans "Associated evidence:" %}
-
- {% for evidence in node.direct_evidences %} - {% if evidence.attachment %} -
  • {{ evidence.name }}
  • - {% else %} -
  • {{ evidence.name }}
  • - {% endif %} - {% endfor %} -
    - {% endif %} - {% if node.applied_controls %} -
    -
    -
    {% trans "Applied controls:" %}
    -
    {% trans "Evidence of applied controls:" %}
    -
    -
    -
    - {% for control in node.applied_controls %} -
  • {{ control.measure.name }}: {{ control.measure.get_result_display }}
  • - {% endfor %} -
    -
    - {% for control in node.applied_controls %} - {% for evidence in control.evidences %} - {% if evidence.attachment %} -
  • {{ control.measure.name }}/{{ evidence.name }}
  • - {% else %} -
  • {{ evidence.name }}
  • - {% endif %} - {% endfor %} - {% endfor %} -
    -
    -
    {% endif %} +
    +
    + {% if node.assessments.requirement.description %} +
    + {{ node.assessments.requirement.get_description_translated }} +
    + {% endif %} {% if node.assessments.answer %} {% for question in + node.assessments.answer.questions %} +
    +

    {{ question.text }}

    + {% if question.answer %} + {{ question.answer }} + {% else %} + {% trans "No answer" %} + {% endif %} +
    + {% endfor %} {% endif %} {% if node.assessments.observation %} +
    +

    {% trans "Observation:" %}

    +

    {{ node.assessments.observation }}

    +
    {% endif %} -
    - {% for child_node in node.children %} - {% include "snippets/req_node.html" with node=child_node %} +
    + {% if node.bar_graph %} {% bar_graph assessments ancestors + node.requirement_node %} {% endif %} {% if node.direct_evidences %} +
    +
    +
    {% trans "Associated evidence:" %}
    +
    + {% for evidence in node.direct_evidences %} {% if evidence.attachment %} +
  • + {{ evidence.name }} +
  • + {% else %} +
  • {{ evidence.name }}
  • + {% endif %} {% endfor %} +
    + {% endif %} {% if node.applied_controls %} +
    +
    +
    {% trans "Applied controls:" %}
    +
    {% trans "Evidence of applied controls:" %}
    +
    +
    +
    + {% for control in node.applied_controls %} +
  • + {{ control.measure.name }}: {{ control.measure.get_result_display }} +
  • {% endfor %} +
    +
    + {% for control in node.applied_controls %} {% for evidence in + control.evidences %} {% if evidence.attachment %} +
  • + {{ control.measure.name }}/{{ evidence.name }} +
  • + {% else %} +
  • {{ evidence.name }}
  • + {% endif %} {% endfor %} {% endfor %} +
    +
    + {% endif %} {% endif %} +
    + {% for child_node in node.children %} {% include "snippets/req_node.html" + with node=child_node %} {% endfor %} +
    diff --git a/backend/core/templates/snippets/ri_list_nested.html b/backend/core/templates/snippets/ri_list_nested.html index 59ee6d103..bef0fd332 100644 --- a/backend/core/templates/snippets/ri_list_nested.html +++ b/backend/core/templates/snippets/ri_list_nested.html @@ -1,100 +1,151 @@ {% load i18n %} -{% load static tailwind_tags %} - - - - - - - - - - - - {% for scenario in scenarios %} - - - - - - - - - - - {% empty %} - - - - {% endfor %} - + + + + + + + + + + + + {% for scenario in scenarios %} + + + + + + + + + + + {% empty %} + + + + {% endfor %} +
    - {% trans "ID" %} - - {% trans "Name" %} - - {% trans "Threats" %} - - {% trans "Existing controls" %} - - {% trans "Current risk level" %} - - {% trans "Residual risk level" %} - - {% trans "Status" %} - - {% trans "Suggested measures" %} -
    - {{ scenario.ref_id }} - -
    - -
    -

    - {{ scenario.name }} -

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

    - {{ threat.get_name_translated }} -

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

    {{ scenario.existing_controls|linebreaksbr }}

    -
    -

    - {{ scenario.get_current_risk.name }} -

    -
    -

    - {{ scenario.get_residual_risk.name }} -

    -
    - {{ scenario.get_treatment_display }} - -
      - {% for measure in scenario.applied_controls.all %} -
    • -

      - {{ measure }} -

      -
    • - {% endfor %} -
    -
    - -

    {% trans "No scenario found." %}

    -
    + {% trans "ID" %} + + {% trans "Name" %} + + {% trans "Threats" %} + + {% trans "Existing controls" %} + + {% trans "Current risk level" %} + + {% trans "Residual risk level" %} + + {% trans "Status" %} + + {% trans "Suggested measures" %} +
    + {{ scenario.ref_id }} + +
    +
    +

    + {{ scenario.name }} +

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

    {{ threat.get_name_translated }}

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

    + {{ scenario.existing_controls|linebreaksbr }} +

    +
    +

    + {{ scenario.get_current_risk.name }} +

    +
    +

    + {{ scenario.get_residual_risk.name }} +

    +
    + {{ scenario.get_treatment_display }} + +
      + {% for measure in scenario.applied_controls.all %} +
    • +

      + {{ measure }} +

      +
    • + {% endfor %} +
    +
    + +

    {% trans "No scenario found." %}

    +
    diff --git a/backend/core/templates/snippets/risk_legend.html b/backend/core/templates/snippets/risk_legend.html index 72f20cdea..cad8025b1 100644 --- a/backend/core/templates/snippets/risk_legend.html +++ b/backend/core/templates/snippets/risk_legend.html @@ -1,21 +1,19 @@ {% load i18n core_extras %}
    -

    {% trans "Risk levels" %}

    -
    - - {% for risk in risk_matrix.parse_json_translated.risk %} - - - - - - {% endfor %} -
    - - {{ risk.name }} - - {{ risk.description|linebreaksbr }} -
    -
    +

    {% trans "Risk levels" %}

    +
    + + {% for risk in risk_matrix.parse_json_translated.risk %} + + + + + + {% endfor %} +
    {{ risk.name }}{{ risk.description|linebreaksbr }}
    +