{# Dashboard history/activity block — pipeline summary + the three activity tables. Rendered inline on full page load and re-fetched by the polling wrapper (#dashboard-history) in index.html so these tables live-update without a full reload. Context: pipeline_summary, recent_runs, user_activity, pipeline_events — supplied by both dashboard.index() and dashboard.history_fragment(). #}

Pipeline Summary

{% if pipeline_summary %}
{% for status, count in pipeline_summary.items() %}
{{ count }} {{ status | replace('_', ' ') | title }}
{% endfor %}
{% else %}

No pipeline data yet — jobs will appear here once ingestion runs.

{% endif %}

Recent Activity

{% if recent_runs %}
{% for run in recent_runs %} {% endfor %}
Timestamp Source Fetched New
{{ run.timestamp[:19] | replace('T', ' ') }} {{ run.source }} {{ run.jobs_fetched }} {{ run.jobs_new }}
{% else %}

No ingestion runs yet. Click "Sync Now" to trigger your first run.

{% endif %}

User Activity

{% if user_activity %}
{% for item in user_activity %} {% set meta = item.metadata | from_json if item.metadata else {} %} {% endfor %}
Timestamp Action Entity Details
{{ item.occurred_at[:19] | replace('T', ' ') }} {{ item.action | replace('_', ' ') | title }} {{ item.entity_id or '' }} {% if meta.jobs_new is defined %} {{ meta.jobs_new }} new jobs {% elif meta.scored is defined %} {{ meta.scored }}/{{ meta.total }} scored {% elif meta.status is defined %} {{ meta.status }} {% endif %}
{% else %}

No user activity recorded yet.

{% endif %}

Pipeline Changes

{% if pipeline_events %}
{% for event in pipeline_events %} {% endfor %}
Timestamp Job Change Source
{{ event.timestamp[:19] | replace('T', ' ') }} {% if event.job_title %} {{ event.job_title }} {% if event.job_company %} — {{ event.job_company }} {% endif %} {% else %} {{ event.job_id }} {% endif %} {{ event.from_status | replace('_', ' ') | title }} {{ event.to_status | replace('_', ' ') | title }} {% if event.source == 'auto-detected' %} auto-detected {% elif event.source == 'email' %} email {% elif event.source == 'kanban drag' %} kanban drag {% else %} {{ event.source or 'manual' }} {% endif %}
{% else %}

No pipeline changes yet — status updates will appear here.

{% endif %}