{# Shared base for instrument/processor "run record" pages (-DR). run_view() provides the title, download button and embedded processor reference card; the record-type- specific body is supplied by the caller via {% call %}. See run_page.jinja.html for the generic fallback, and an issuer's own dedicated run templates for specific ones. #} {% import "pac_info/base-components.jinja.html" as pac_macros with context %} {% macro qty(q) -%} {%- if q is none -%}—{%- else -%}{{ q.value_as_str() }}{% if q.unit_display %} {{ q.unit_display }}{% endif %}{%- endif -%} {%- endmacro %} {% macro run_view(title, processor_pac_id) %}
{{ run_header(title) }} {{ instrument_info_box(processor_pac_id) }} {{ caller() }}
{% endmacro %} {% macro run_header(title) %}

{{ title }}

{% endmacro %} {% macro instrument_info_box(processor_pac_id) %} {% if processor_pac_id %}
{{ pac_macros.reference(processor_pac_id, card_request_params={'card_type': 'small'}, target_class='lf-card-embedded', display_label=False) }}
{% endif %} {% endmacro %} {% macro stat_group(title, rows) %}
{% if title %}
{{ title }}
{% endif %} {% for label, actual, set_val in rows %}
{{ label }} {{ actual }}{% if set_val is not none %} of {{ set_val }}{% endif %}
{% endfor %}
{% endmacro %} {# A single-box instrument view: one flat group of readings, no sub-groups. Used by record types that report just one run (not multiple positions) - e.g. Rotavapor, Spray Dryer. Notification lists (or any other issuer-specific content) are the caller's own concern - render them alongside run_box(), not inside it, since notification rendering is issuer-specific, not generic. #} {% macro run_box(rows) %}
{{ stat_group(none, rows) }}
{% endmacro %}