@@ -16,47 +16,63 @@ <h3 class="fs-6 fw-medium mb-0">{% trans "Policy violations" %}</h3>
1616 < i class ="fas fa-circle-info small "> </ i >
1717 </ button >
1818 </ div >
19+ < div class ="d-flex align-items-center gap-2 ">
20+ {% if has_change_permission %}
21+ < form hx-post ="{{ product.get_evaluate_policy_rules_url }} "
22+ hx-swap ="none "
23+ hx-on--before-request ="NEXB.displayOverlay('{% trans "Re-evaluating policy rules... " %}')">
24+ {% csrf_token %}
25+ < button type ="submit "
26+ class ="btn btn-link p-0 text-body-tertiary lh-1 "
27+ data-bs-toggle ="tooltip "
28+ data-bs-title ="{% trans 'Re-evaluate policy rules' %} "
29+ aria-label ="{% trans 'Re-evaluate policy rules' %} ">
30+ < i class ="fas fa-rotate-right small pb-1 "> </ i >
31+ </ button >
32+ </ form >
33+ {% endif %}
34+ < span class ="badge bg-danger-subtle text-danger-emphasis ">
35+ {{ policy_violation_count }} {% trans "active" %}
36+ </ span >
37+ </ div >
38+ </ div >
1939
20- < div class ="modal fade " id ="active-rules-modal " tabindex ="-1 " aria-labelledby ="active-rules-modal-label " aria-hidden ="true ">
21- < div class ="modal-dialog ">
22- < div class ="modal-content ">
23- < div class ="modal-header ">
24- < h5 class ="modal-title fs-6 fw-medium " id ="active-rules-modal-label "> {% trans "Active rules" %}</ h5 >
25- < button type ="button " class ="btn-close " data-bs-dismiss ="modal " aria-label ="{% trans 'Close' %} "> </ button >
26- </ div >
27- < div class ="modal-body p-0 ">
28- {% for rule in all_rules %}
29- < div class ="d-flex align-items-start justify-content-between px-3 py-3 {% if not forloop.last %}border-bottom{% endif %} ">
30- < div class ="me-3 ">
40+ < div class ="modal fade " id ="active-rules-modal " tabindex ="-1 " aria-labelledby ="active-rules-modal-label " aria-hidden ="true ">
41+ < div class ="modal-dialog ">
42+ < div class ="modal-content ">
43+ < div class ="modal-header ">
44+ < h5 class ="modal-title fs-6 fw-medium " id ="active-rules-modal-label "> {% trans "Active rules" %}</ h5 >
45+ < button type ="button " class ="btn-close " data-bs-dismiss ="modal " aria-label ="{% trans 'Close' %} "> </ button >
46+ </ div >
47+ < div class ="modal-body p-0 ">
48+ {% for rule in all_rules %}
49+ < div class ="d-flex align-items-start justify-content-between px-3 py-3 {% if not forloop.last %}border-bottom{% endif %} ">
50+ < div class ="me-3 ">
51+ {% if rule.severity == "error" %}
52+ < span class ="badge bg-danger-subtle text-danger-emphasis mb-1 "> {{ rule.label }}</ span >
53+ {% else %}
54+ < span class ="badge bg-warning-subtle text-warning-emphasis mb-1 "> {{ rule.label }}</ span >
55+ {% endif %}
56+ < div class ="text-body-secondary small "> {{ rule.description }}</ div >
57+ </ div >
58+ < div class ="flex-shrink-0 ">
59+ {% if not rule.is_active %}
60+ < span class ="badge text-bg-secondary "> {% trans "Disabled" %}</ span >
61+ {% elif rule.is_violated %}
3162 {% if rule.severity == "error" %}
32- < span class ="badge bg-danger-subtle text-danger-emphasis mb-1 "> {{ rule.label }}</ span >
33- {% else %}
34- < span class ="badge bg-warning-subtle text-warning-emphasis mb-1 "> {{ rule.label }}</ span >
35- {% endif %}
36- < div class ="text-body-secondary small "> {{ rule.description }}</ div >
37- </ div >
38- < div class ="flex-shrink-0 ">
39- {% if not rule.is_active %}
40- < span class ="badge text-bg-secondary "> {% trans "Disabled" %}</ span >
41- {% elif rule.is_violated %}
42- {% if rule.severity == "error" %}
43- < span class ="badge bg-danger-subtle text-danger-emphasis "> {% trans "Triggered" %}</ span >
44- {% else %}
45- < span class ="badge bg-warning-subtle text-warning-emphasis "> {% trans "Triggered" %}</ span >
46- {% endif %}
63+ < span class ="badge bg-danger-subtle text-danger-emphasis "> {% trans "Triggered" %}</ span >
4764 {% else %}
48- < span class ="badge bg-success -subtle text-success -emphasis "> {% trans "OK " %}</ span >
65+ < span class ="badge bg-warning -subtle text-warning -emphasis "> {% trans "Triggered " %}</ span >
4966 {% endif %}
50- </ div >
67+ {% else %}
68+ < span class ="badge bg-success-subtle text-success-emphasis "> {% trans "OK" %}</ span >
69+ {% endif %}
5170 </ div >
52- {% endfor %}
53- </ div >
71+ </ div >
72+ {% endfor %}
5473 </ div >
5574 </ div >
5675 </ div >
57- < span class ="badge bg-danger-subtle text-danger-emphasis ">
58- {{ policy_violation_count }} {% trans "active" %}
59- </ span >
6076 </ div >
6177 < table class ="table table-sm align-middle mb-0 ">
6278 < thead >
0 commit comments