From 9e71513f303ccf4393314f491d322f7e7befb9bb Mon Sep 17 00:00:00 2001 From: Tushar Goel Date: Tue, 5 Dec 2023 14:28:46 +0530 Subject: [PATCH] Format package_details.html Signed-off-by: Tushar Goel --- .../templates/package_details.html | 555 +++++++++--------- 1 file changed, 287 insertions(+), 268 deletions(-) diff --git a/vulnerabilities/templates/package_details.html b/vulnerabilities/templates/package_details.html index 8359d0bcb..558317e0c 100644 --- a/vulnerabilities/templates/package_details.html +++ b/vulnerabilities/templates/package_details.html @@ -13,290 +13,309 @@ {% if package %} -
-
- + + -
-
-
-
- - - - + + + +
- +
+
+
+
+ + + + - - - -
+ purl - - - {{ fixed_package_details.purl.to_string }} -
-
- {% if affected_by_vulnerabilities|length != 0 %} + +
+ {{ fixed_package_details.purl.to_string }} +
+
+ {% if affected_by_vulnerabilities|length != 0 %} -
- - - - - - - - - - - -
- Next non-vulnerable version - - {% if fixed_package_details.next_non_vulnerable.version %} - {{ fixed_package_details.next_non_vulnerable.version }} - {% else %} - None. - {% endif %} -
- Latest non-vulnerable version - - {% if fixed_package_details.latest_non_vulnerable.version %} - {{ fixed_package_details.latest_non_vulnerable.version }} - {% else %} - None. - {% endif %} -
-
+
+ + + + + + + + + + + +
+ Next non-vulnerable version + + {% if fixed_package_details.next_non_vulnerable.version %} + {{ fixed_package_details.next_non_vulnerable.version }} + {% else %} + None. + {% endif %} +
+ Latest non-vulnerable version + + {% if fixed_package_details.latest_non_vulnerable.version %} + {{ fixed_package_details.latest_non_vulnerable.version }} + {% else %} + None. + {% endif %} +
+
- {% endif %} + {% endif %} -
-
- Vulnerabilities affecting this package ({{ affected_by_vulnerabilities|length }}) -
- - - - - - - - - - - - {% for vulnerability in affected_by_vulnerabilities %} - - - - - - {% empty %} - - - - {% endfor %} - -
VulnerabilitySummaryFixed by
- {{ vulnerability.vulnerability_id }} -
- Aliases: -
- {% for alias in vulnerability.alias %} - {% if alias.url %} - {{ alias }} -
- {% else %} - {{ alias }} -
- {% endif %} - {% endfor %} -
- {{ vulnerability.summary }} - - {% if package.purl == fixed_package_details.purl.to_string %} - {% for key, value in fixed_package_details.items %} - {% if key == "vulnerabilities" %} - {% for vuln in value %} - {% if vuln.vulnerability.vulnerability_id == vulnerability.vulnerability_id %} - {% if vuln.fixed_by_package_details is None %} - There are no reported fixed by versions. - {% else %} - {% for fixed_pkg in vuln.fixed_by_package_details %} -
- {% if fixed_pkg.fixed_by_purl_vulnerabilities|length == 0 %} - {{ fixed_pkg.fixed_by_purl.version }} -
- Affected by 0 other vulnerabilities. - {% else %} - {{ fixed_pkg.fixed_by_purl.version }} - {% if fixed_pkg.fixed_by_purl_vulnerabilities|length != 1 %} -
- Affected by {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other vulnerabilities. - {% else %} -
- Affected by {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other vulnerability. - {% endif %} - - - {% endif %} -
- {% endfor %} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% endfor %} - {% endif %} -
- This package is not known to be affected by vulnerabilities. -
+
+
+ Vulnerabilities affecting this package ({{ affected_by_vulnerabilities|length }})
- -
-
- Vulnerabilities fixed by this package ({{ fixing_vulnerabilities|length }}) -
- - - - - - - - - - - {% for vulnerability in fixing_vulnerabilities %} - - - - - - {% empty %} - - - - {% endfor %} - -
VulnerabilitySummaryAliases
- {{ vulnerability.vulnerability_id }} - - {{ vulnerability.summary }} - - {% for alias in vulnerability.alias %} - {% if alias.url %} - {{ alias }} -
- {% else %} - {{ alias }} -
- {% endif %} - {% endfor %} -
- This package is not known to fix vulnerabilities. -
- -
+ + + + + + + + + + + + {% for vulnerability in affected_by_vulnerabilities %} + + + + + + {% empty %} + + + + {% endfor %} + +
VulnerabilitySummaryFixed by
+ {{vulnerability.vulnerability_id }} +
+ Aliases: +
+ {% for alias in vulnerability.alias %} + {% if alias.url %} + {{ alias }} +
+ {% else %} + {{ alias }} +
+ {% endif %} + {% endfor %} +
+ {{ vulnerability.summary }} + + {% if package.purl == fixed_package_details.purl.to_string %} + {% for key, value in fixed_package_details.items %} + {% if key == "vulnerabilities" %} + {% for vuln in value %} + {% if vuln.vulnerability.vulnerability_id == vulnerability.vulnerability_id %} + {% if vuln.fixed_by_package_details is None %} + There are no reported fixed by versions. + {% else %} + {% for fixed_pkg in vuln.fixed_by_package_details %} +
+ {% if fixed_pkg.fixed_by_purl_vulnerabilities|length == 0 %} + {{ fixed_pkg.fixed_by_purl.version }} +
+ Affected + by 0 other vulnerabilities. + {% else %} + {{ fixed_pkg.fixed_by_purl.version }} + {% if fixed_pkg.fixed_by_purl_vulnerabilities|length != 1 %} +
+ Affected + by {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other + vulnerabilities. + {% else %} +
+ Affected + by {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other + vulnerability. + {% endif %} + + + {% endif %} +
+ {% endfor %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} +
+ This package is not known to be affected by vulnerabilities. +
+
+ +
+
+ Vulnerabilities fixed by this package ({{ fixing_vulnerabilities|length }})
+ + + + + + + + + + + {% for vulnerability in fixing_vulnerabilities %} + + + + + + {% empty %} + + + + {% endfor %} + +
VulnerabilitySummaryAliases
+ {{ vulnerability.vulnerability_id }} + + {{ vulnerability.summary }} + + {% for alias in vulnerability.alias %} + {% if alias.url %} + {{ alias }} +
+ {% else %} + {{ alias }} +
+ {% endif %} + {% endfor %} +
+ This package is not known to fix + vulnerabilities. +
+ +
-
- - - - - - - - - - - - {% for log in history %} + +
+
Date - Actor - - Action Vulnerability - Source - - - VulnerableCode Version - -
+ - - - - - - + + + + + + - {% endfor %} -
{{ log.get_iso_time }}{{ log.actor_name }}{{ log.get_action_type_label }} {{ log.related_vulnerability }} {{log.source_url }} {{ log.software_version }} Date + Actor + + Action Vulnerability + Source + + + VulnerableCode Version + +
-
+ + {% for log in history %} + + {{ log.get_iso_time }} + {{ log.actor_name }} + {{ log.get_action_type_label }} + {{ log.related_vulnerability }} + {{log.source_url }} + {{ log.software_version }} + + {% endfor %} +
-
- + + + {% endif %} {% endblock %} \ No newline at end of file