<style>
    table,
    tr,
    td,
    div {
        page-break-inside: avoid !important;
    }
</style>
<section id="contents">
    <div class="container">
        <div class="row">
            <div class="col-12 mt-3">
                <span class="h3 text-primary">Details <small>(Vendor - Product - Version)</small> </span>
                <hr class="bg-danger">    
            </div>
            <span class="h6 text-secondary text-right">{{ star_warn }}</span>
            {% for product_info, cve_data in all_cve_data.items() %}
                <div class="col-12  mt-3">
                    {% if product_info.vendor != "UNKNOWN" %}
                        <span class="h5">{{ product_info.vendor }}  {{ product_info.product }}  {{ product_info.version }}</span>
                    {% else %}
                        <span class="h5">{{ product_info.product }}  {{ product_info.version }}</span>
                    {% endif %}
                    <span class="h5 float-right mr-5">CVE Count: {{ 0 if cve_data["cves"][0][1] == "UNKNOWN" else cve_data['cves'] | length }}</span><hr \>
                </div>
                <!-- If CVE Number UNKNOWN don't render -->
                {% if cve_data["cves"][0][1] != "UNKNOWN" %}
                    <div class="col-12 mt-2">    
                        <table class="table table-bordered text-center">
                            <tr class="table-secondary">
                                <th>CVE Number</th>
                                <th>Description</th>
                                <th>Severity</th>
                                <th>Remarks</th>
                            </tr>    
                        {% for cve in cve_data['cves'] %}
                            <tr>
                                <td>{{ cve.cve_number }}</td>
                                <td>{{ cve.description }}</td>
                                <td>{{ cve.severity }}</td>
                                <td>{{ cve.remarks }}</td>
                            </tr>
                        {% endfor %}
                        </table>
                    </div>
                {% endif %}
                <!-- If there's no path don't render -->
                {% if directory | length != 0 and cve_data['paths'] | length != 0 %}
                    <div class="col-12 mt-3">
                        <table class="table table-bordered" >
                            <tr>                                    
                                <th class="table-secondary text-center"> Paths Associated with {{ product_info.product }}-{{ product_info.version }}</th>
                            </tr>
                            {% for path in cve_data['paths']%}
                            <tr>
                                <td>{{ path }}</td>
                            </tr>
                            {% endfor%}
                        </table>
                    </div>
                {% endif %}
            {% endfor %}  
        </div>
    </div>
</section>