{# app/templates/partials/_macros.html Shared Jinja macros for the LitterBox UI. Scanner-table macros: {% from 'partials/_macros.html' import scanner_table_header, scanner_yara_row, scanner_status_cell, scanner_count_cell %} These eliminate duplication between static_info.html and dynamic_info.html (both render the same scanner-result table format). #} {# Renders the of a scanner-results table. #} {% macro scanner_table_header() -%} Scanner Status Detections Details {%- endmacro %} {# Renders the Detected / Clean status badge cell. #} {% macro scanner_status_cell(detections) -%} {{ 'Detected' if detections else 'Clean' }} {%- endmacro %} {# Renders the detection-count cell (red if any, mute if zero). #} {% macro scanner_count_cell(detections) -%} {{ detections }} {%- endmacro %} {# Renders the 3-chip "Overall Status / Total Detections / Duration" panel. #} {% macro status_grid_3(total, duration_label, duration_value) -%}
Overall Status
Status
{{ 'Detections' if total > 0 else 'Clean' }}
Detections
{{ total }}
{{ duration_label }}
{{ duration_value }}
{%- endmacro %} {# Full YARA scanner row — identical between static and dynamic result pages. #} {% macro scanner_yara_row(detections, matches) -%} YARA {{ scanner_status_cell(detections) }} {{ scanner_count_cell(detections) }} {% if detections %}
{% for match in matches %}
Rule: {{ match.rule }} {% if match.metadata %}(Severity: {{ match.metadata.severity }}){% endif %}
{% endfor %}
{% else %} No rules matched {% endif %} {%- endmacro %}