{# A padlock, marking what needs a passkey #} {% macro lock() -%} {%- endmacro %} {% macro card(entry, csrf, open) %}

{{ entry.summary }}

{{ entry.requester }} · {{ entry.op }} · expires in {{ self::elapsed(*entry.expires_in) }} {%- if entry.passkey %} {% call lock() %}{% endcall %}Needs passkey{% endif %} {%- if entry.sensitive %} Sensitive{% endif %}

{% if let Some(label) = entry.label %}

Label (agent-supplied): {{ label }}

{% endif %} {% call detail(entry.detail, open) %}{% endcall %}
{% for decision in entry.offers %} {% let deny = self::is_deny(decision) %} {% endfor %}
{% if entry.passkey %}

Policy wants a fresh passkey for this one: approving sends you to sign in again. Denying doesn't.

{% endif %}
{% endmacro %} {# Fields stay in view; tables, lists and text fold away unless `open`. #} {% macro detail(detail, open) %} {% if !detail.fields.is_empty() %}
{% for field in detail.fields %}
{{ field.label }}
{% if field.code %}{{ field.value }}{% else %}{{ field.value }}{% endif %}
{% endfor %}
{% endif %} {% if !detail.sections.is_empty() %} Details ({{ self::section_titles(detail) }}) {% for section in detail.sections %}

{{ section.title() }}

{% match section %} {% when Section::Table with { columns, rows, more, .. } %}
{% for column in columns %}{% endfor %} {% for row in rows %}{% for cell in row.cells %}{% if self::is_code(columns, loop.index0) %}{% else %}{% endif %}{% endfor %} {% endfor %}
{{ column.title }}
{{ cell }}{{ cell }}
{% if *more > 0 %}

… {{ more }} more

{% endif %} {% when Section::List with { items, more, code, .. } %} {% if *more > 0 %}

… {{ more }} more

{% endif %} {% when Section::Text with { text, diff, .. } %} {% if *diff %}
{% for (kind, line) in self::diff_lines(text) %}{{ line }}
{% endfor %}
{% else %}
{{ text }}
{% endif %} {% endmatch %}
{% endfor %} {% endif %} {% endmacro %} {% macro time(rfc3339) -%} {%- endmacro %} {% macro outcome(outcome) -%} {{ outcome.name() }} {%- endmacro %} {% macro timeline(records) %}
    {% for record in records %} {% let (text, detail) = self::describe(record) %}
  1. {% call time(record.time) %}{% endcall %} {{ text }} {%- if let Some(detail) = detail %}{% call detail(detail, false) %}{% endcall %}{% endif %}
  2. {% endfor %}
{% endmacro %} {% macro select(name, label, chosen, options) -%} {%- endmacro %} {# A bar for a phase: its count if it has one, otherwise just whether it's going. #} {% macro meter(progress) -%} {% if let Some(count) = progress.bar() -%} {%- else if self::running(progress) -%} {%- else -%} {%- endif %} {%- endmacro %} {# A request's whole progress in one bar, for lists. #} {% macro run_meter(run) -%} {% if let Some(count) = run.phases.bar() -%} {%- else -%} {%- endif %} {%- endmacro %}