Skip to content

Commit

Permalink
Exposure category, quantity_kind should display
Browse files Browse the repository at this point in the history
Wasn't handling multiple categories; also quantity_kind file was misnamed
  • Loading branch information
lydiascarf committed Jun 14, 2024
1 parent ad9a8de commit 5e6b50b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion _data/schemas/rdl-02.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ exposure:
- others
- field_name: quantity_kind
label: Metric Quantity Kind
display_template: display/quality_kind.html
display_template: display/quantity_kind.html

# VulnerabilityModel
vulnerability:
Expand Down
14 changes: 11 additions & 3 deletions _includes/display/exposure_category.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<tr>
<th>{{ include.field.label }}</th>
<td>
{% capture code %}{{ include.value }}{% endcapture %}
{{ site.data.rdl-exposure_category[code] }}
</td>
{% assign split_string = include.value | split: ", " %}
{% if split_string[0] %}
{% for code in split_string %}
{{ site.data.rdl-exposure_category[code] }}{% unless forloop.last or site.data.rdl-exposure_category[code] == nil %}, {% endunless %}
{% endfor %}
{% else %}
{% capture code %}{{ include.value }}{% endcapture %}
{{ site.data.rdl-exposure_category[code] }}
{% endif %}
</td>

6 changes: 0 additions & 6 deletions _includes/display/quality_kind.html

This file was deleted.

13 changes: 13 additions & 0 deletions _includes/display/quantity_kind.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<tr>
<th>{{ include.field.label }}</th>
<td>
{% assign split_string = include.value | split: ", " %}
{% if split_string[0] %}
{% for code in split_string %}
{{ site.data.rdl-quantity_kind[code] }}{% unless forloop.last or site.data.rdl-quantity_kind[code] == nil %}, {% endunless %}
{% endfor %}
{% else %}
{% capture code %}{{ include.value }}{% endcapture %}
{{ site.data.rdl-quantity_kind[code] }}
{% endif %}
</td>

0 comments on commit 5e6b50b

Please sign in to comment.