Skip to content

Commit

Permalink
chg: [templates] Improved lookup of the description for cvelistv5_vie…
Browse files Browse the repository at this point in the history
…w macro view.
  • Loading branch information
cedricbonhomme committed Dec 10, 2024
1 parent bdb3dad commit f4a929c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions website/web/templates/vulnerability_templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,18 @@ <h6 class="card-subtitle mb-2 text-body-secondary">
<span id="epss-percentile" style="text-decoration:underline dotted" data-bs-toggle="tooltip" data-bs-placement="right" title="The percentile of the current score, the proportion of all scored vulnerabilities with the same or a lower EPSS score."></span>
</div>
</div>
{% if vulnerability_data['containers']['cna']['title'] %}
{% if vulnerability_data['containers']['cna']['descriptions'] %}
{% set languages = ['eng', 'en'] %}
<div class="row">
<div class="col-md-2 fw-bold">Summary</div><div class="col">{{vulnerability_data['containers']['cna']['title']}}</div>
{% for item in vulnerability_data['containers']['cna']['descriptions'] %}
{% if item['lang'] in languages %}
<div class="col-md-2 fw-bold">Summary</div><div class="col">{{ item['value'] }}</div>
{% endif %}
{% endfor %}
</div>
{% else %}
{% elif vulnerability_data['containers']['cna']['title'] %}
<div class="row">
<div class="col-md-2 fw-bold">Summary</div><div class="col">{{vulnerability_data['containers']['cna']['descriptions'][0]['value']}}</div>
<div class="col-md-2 fw-bold">Summary</div><div class="col">{{vulnerability_data['containers']['cna']['title']}}</div>
</div>
{% endif %}
{% if 'meta' in vulnerability_data and 'nvd' in vulnerability_data['meta'] %}
Expand Down Expand Up @@ -717,7 +722,7 @@ <h6 class="card-subtitle mb-2 text-body-secondary">
<div class="col">{{ vulnerability_data['gsd']['osvSchema']['details'] }}</div>
{% else %}
{% set namespaces = ['cisa.gov', 'cve.org', 'gitlab.com', 'nvd.nist.gov'] %}
{% set languages = ['eng'] %}
{% set languages = ['eng', 'en'] %}
{% for namespace in namespaces %}
{% if vulnerability_data['namespaces'].get(namespace, false) %}
{% if 'description' in vulnerability_data['namespaces'][namespace] %}
Expand Down

0 comments on commit f4a929c

Please sign in to comment.