{% from "_macros.html" import state_chip, avatar, entity_link, panel_link, decision_link %} {% if tab == "values" %}
{% for a in d.attributes %}

{{ icon(ATTRIBUTE_ICONS.get(a.attribute, 'circle-dashed'), 14) }} {{ a.attribute|replace('_', ' ') }} {{ plural(a.values|length, 'value') }} across {{ plural(a.observed, 'observation') }}

{% for v in a.values[:12] %}
{{ fmt(v.value) }}
{{ v.observations|length }} / {{ a.observed }}
{% endfor %} {% if a.values|length > 12 %}
+{{ a.values|length - 12 }} more values
{% endif %}
{% endfor %}
{% elif tab == "members" %}
{% for m in d.members %} {% endfor %}
{{ icon("id", 14) }} Name{{ icon("database", 14) }} Source{{ icon("world", 14) }} Location{{ icon("hash", 14) }} Observation
{% if m.attributes is none %}redacted{% else %}{{ m.attributes.get('name') or '' }}{% endif %} {{ m.source.type }} {{ m.source.id }} {% if m.attributes %}{{ [m.attributes.get('city'), m.attributes.get('country')]|select|join(', ') }}{% endif %} {{ m.observation_id }}
{{ d.members_offset + 1 }}–{{ d.members_offset + d.members|length }} of {{ "{:,}".format(d.member_count) }} {% if page > 1 %}Previous{% endif %} {% if d.members_offset + d.members|length < d.member_count %}Next{% endif %}
{% elif tab == "relationships" %}
{% if not d.relationships and not d.relationship_candidates %}
No relationships, and no signals suggesting any.
{% endif %} {% if d.relationships %}
Relationships
{% for r in d.relationships %}
{% if r.role == "subject" %}This entity {{ r.relationship.relation|replace('_', ' ') }} {{ entity_link(r.other_id, r.other_label) }} {% else %}{{ entity_link(r.other_id, r.other_label) }} {{ r.relationship.relation|replace('_', ' ') }} this entity{% endif %} {{ decision_link(r.relationship.basis_decision_id) }}
{% endfor %}
{% endif %} {% if d.relationship_candidates %}
Possibly related a relationship signal, kept apart
{% for c, label in d.relationship_candidates %} {% set other = c.right_entity if c.left_entity == d.entity.entity_id else c.left_entity %}
{{ entity_link(other, label) }} {{ plural(c.pairs, 'pair') }}{% for s in c.signals %}{{ s }}{% endfor %}
{{ icon("scale", 14) }} Decide
{% endfor %}
{% endif %}
{% elif tab == "history" %}
{% for c in commits %}
{{ icon(c.lines[0][0] if c.lines else 'circle-dashed', 13) }}
{% for ic, text, ref, name in c.lines %}
{{ text }}{% if ref %} {{ name }}{% endif %}
{% endfor %}
{{ c.actor.kind }}: {{ c.actor.id }} {% for dec in c.decisions[:3] %}{{ decision_link(dec) }}{% endfor %} {% if c.decisions|length > 3 %}+{{ c.decisions|length - 3 }}{% endif %}
seq {{ c.seq }}{% if c.last_seq != c.seq %}–{{ c.last_seq }}{% endif %} · {{ fmt(c.at) }}
{% endfor %}
{% elif tab == "context" %}
What a language model would be given about this entity, at most {% for b in [1000, 2000, 4000, 8000] %} {{ "{:,}".format(b) }} {% endfor %} characters. {{ "{:,}".format(text|length) }} used
{{ text }}
{% endif %}