File size: 4,035 Bytes
a0f27fa
 
 
 
 
430d0f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a0f27fa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{% extends "base.html" %}
{% block title %}Archive — Research Intelligence{% endblock %}
{% block content %}
<div class="page-header">
    <h1>Weekly Archives</h1>
    <div class="subtitle">Search past papers and browse weekly reports</div>
</div>

<div class="filter-bar" style="margin-bottom:1.5rem">
    <form hx-get="/weeks" hx-target="#archive-results" hx-push-url="true"
          hx-trigger="submit" hx-indicator="#page-loader"
          style="display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; width:100%">
        <input type="search" name="q" placeholder="Search all papers..." value="{{ q }}"
               class="filter-input" style="flex:1; min-width:200px">
        <select name="domain" class="filter-select">
            <option value="">All domains</option>
            <option value="aiml" {% if domain == 'aiml' %}selected{% endif %}>AI/ML</option>
            <option value="security" {% if domain == 'security' %}selected{% endif %}>Security</option>
        </select>
        <select name="sort" class="filter-select">
            <option value="rank" {% if sort == 'rank' %}selected{% endif %}>Relevance</option>
            <option value="score" {% if sort == 'score' %}selected{% endif %}>Score</option>
            <option value="date" {% if sort == 'date' %}selected{% endif %}>Date</option>
        </select>
        <button type="submit" class="btn btn-primary btn-sm">Search</button>
    </form>
</div>

<div id="archive-results">
    {% if q %}
        {% include "partials/archive_results.html" %}
    {% endif %}
</div>

{% if archives %}
<div class="section-header">
    <h2>Reports</h2>
</div>
<table class="paper-table" style="margin-bottom:2.5rem">
    <thead>
        <tr>
            <th>Week</th>
            <th>Domain</th>
            <th>File</th>
        </tr>
    </thead>
    <tbody>
        {% for a in archives %}
        <tr>
            <td style="font-family:var(--font-mono); font-size:0.82rem">{{ a.date }}</td>
            <td>
                {% if a.domain == 'aiml' %}
                <span class="badge badge--accent">AI/ML</span>
                {% elif a.domain == 'security' %}
                <span class="badge badge--red">SECURITY</span>
                {% else %}
                <span class="badge" style="background:var(--bg-surface); color:var(--text-muted)">{{ a.domain | upper }}</span>
                {% endif %}
            </td>
            <td><a href="/weeks/{{ a.filename }}">{{ a.filename }}</a></td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% else %}
<div class="empty-state" style="padding:2rem">
    <h2>No archives yet</h2>
    <p>Weekly reports will appear here after pipeline runs.</p>
</div>
{% endif %}

{% if runs %}
<div class="section-header">
    <h2>Recent Runs</h2>
</div>
<table class="paper-table">
    <thead>
        <tr>
            <th>ID</th>
            <th>Domain</th>
            <th>Date Range</th>
            <th>Papers</th>
            <th>Status</th>
            <th>Started</th>
        </tr>
    </thead>
    <tbody>
        {% for r in runs %}
        <tr>
            <td style="font-family:var(--font-mono); font-size:0.82rem">{{ r.id }}</td>
            <td>
                {% if r.domain == 'aiml' %}
                <span class="badge badge--accent">AI/ML</span>
                {% elif r.domain == 'security' %}
                <span class="badge badge--red">SECURITY</span>
                {% else %}
                <span class="badge" style="background:var(--bg-surface); color:var(--text-muted)">{{ r.domain | upper }}</span>
                {% endif %}
            </td>
            <td style="font-size:0.82rem">{{ r.date_start }} to {{ r.date_end }}</td>
            <td style="font-family:var(--font-mono)">{{ r.paper_count }}</td>
            <td class="status-{{ r.status }}">{{ r.status }}</td>
            <td style="font-size:0.82rem; color:var(--text-muted)">{{ r.started_at[:16] }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endif %}
{% endblock %}